From: "J.A. Bijsterbosch" Newsgroups: comp.os.msdos.djgpp Subject: Re: Allegro Datafiles - More Problems Date: 1 Feb 1998 08:29:30 GMT Organization: Bijsterbosch Productions Lines: 50 Message-ID: <01bd2e58$23a41ec0$LocalHost@none> References: NNTP-Posting-Host: asd2-p139.worldonline.nl To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Precedence: bulk Hello Matt, Matt Riker schreef in artikel ... > In article , G DOT DegliEsposti AT ads DOT it > says: > > > >Error: array subscript is not an integer Well, this says it all, doesn't it? [ a lot snipped ] > 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 Wrong, spritename must be an int containing a value BLANK represents... > > values assign different ints to spritename. > > I could be just dumb :), but how can you but a string of letters into an > int? Hmm, I think you've got somethings mixed up. The names you use to refer to the several parts of a datafile structure are in fact #defines and represent an unique number for every entry in that datafile. (look at the datafile header you use to see what I mean). Thus making an array of strings containing those names is not going to work since every name in the data header file is no string, it just represents a number, in fact they all are array indexes. Depending on how your program is build, you could either use an int variable to get the right entry from the datafile, or you could, based on your spritename array build a function that uses the array index to return an int value to use in getting the right entry from the datafile. Hope this helped somewhat.. ;-)) ____________________________ > Matt Riker -- Greetings from frosty Amsterdam, Jan Bijsterbosch email: bijster AT worldonline DOT nl http://home.worldonline.nl/~bijster