delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/01/29/15:51:04

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: <MPG.f3a8f8ba7e93c3a9896be@news>
References: <C125659B DOT 002E50AC DOT 00 AT vega DOT ads DOT it>
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

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 -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019