Mail Archives: djgpp/1998/01/29/15:51:04
In article <C125659B DOT 002E50AC DOT 00 AT vega DOT ads DOT it>, 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! ***
- Raw text -