From: SPAMGUARDriker AT pipcom DOT com (Matt Riker) Newsgroups: comp.os.msdos.djgpp Subject: Re: Allegro Datafiles - More Problems Date: Thu, 29 Jan 1998 13:07:57 -0500 Organization: Riker Software Lines: 37 Message-ID: References: Reply-To: SPAMGUARDriker AT pipcom DOT com NNTP-Posting-Host: 207.61.241.233 To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Precedence: bulk In article , G DOT DegliEsposti AT ads DOT it says: > >Error: array subscript is not an integer > > of course: you are trying to do this illegal operation: > > draw_sprite(screen,datafile["BLANK"].dat,16,16); No, I wasn't using quotes :) > I suppose this is what you really want to do: > > draw_sprite(screen,datafile[BLANK].dat,16,16); > > where BLANK is #define'd somewhere... No, what I really want to do is this: draw_sprite(screen,datafile[spritename].dat,16,16); Where 'spritename' is a constantly changing variable. In the middle of my program, I want 'spritename' to be anything, depending on what sprite the user chooses. > the 'spritename' must be an int containing BLANK. If you need to use > different > values assign different ints to spritename. I could be just dumb :), but how can you but a string of letters into an int? ____________________________ Matt Riker SPAMGUARDriker AT pipcom DOT com *** Remove SPAMGUARD *** *** when replying! ***