From: SPAMGUARDriker AT pipcom DOT com (Matt Riker) Newsgroups: comp.os.msdos.djgpp Subject: Allegro Datafiles - More Problems Date: Thu, 29 Jan 1998 01:12:15 -0500 Organization: Riker Software Lines: 36 Message-ID: Reply-To: SPAMGUARDriker AT pipcom DOT com NNTP-Posting-Host: 207.61.241.220 To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Precedence: bulk Leave it to me to run into more problems :) First problem, is when I try and substitute a datafile object with a variable. Example: draw_sprite(screen,datafile[spritename].dat,16,16); spritename is a char with a 20 character array, containing "BLANK". I get this error when compiling: Error: array subscript is not an integer Second problem: having 2 datafiles opened at the same time. Having a datafile already opened seems to cause the second one to return 1. My two DATAFILE declarations are different. My code to open the second datafile is below: { strcpy(get_filename(buf), "c:/maped/testspr.dat"); user_datafile = load_datafile(buf); if (!user_datafile) { allegro_exit(); printf("Error loading TESTSPR.DAT!\n\n"); return 1; } } I *believe* that the problem is due to there already being a datafile open, but am not positive. The datafile is not corrupt, and it's header is correct and in-place. Any help on either of these would be greatly appreciated; thanks! ____________________________ Matt Riker SPAMGUARDriker AT pipcom DOT com *** Remove SPAMGUARD *** *** when replying! ***