Post by ToyDolls0101 on Aug 30, 2002 3:17:39 GMT
Okie Dokie,
I have been trying to write an QBASIC Art editing program for a game i am making. It needs to store an image as well as a text file that stores sertain attruibutes of that tile.
Now when I create a tile and save it.
Then create a new tile
Then load it again
it works fine
BUT
When i RESTART the program and try to load the previously saved file, QBASIC performs and illeagal operation. THIS HAPPENS EXACLY AT the BLOAD statement.
Here is my code:
savetile:
'Get filename
INPUT "SAVE AS"; filename$: IF filename$ = "q" THEN RETURN
'Save attributes to text file
OPEN filename$ + ".dat" FOR OUTPUT AS #1
PRINT #1, filename$
PRINT #1, tag.BN
PRINT #1, tag.BS
PRINT #1, tag.BE
PRINT #1, tag.BW
PRINT #1, tag.D
PRINT #1, tag.S
CLOSE
'Save graphic
GET (101, 101)-(129, 129), im
DEF SEG = VARSEG(im(1))
BSAVE filename$, VARPTR(im(1)), 12000
DEF SEG = VARSEG(a(0))
'set filenames
currentfile$ = filename$ + " "
filename$ = ""
RETURN
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
loadtile:
'get filename
INPUT "LOAD"; filename$: IF filename$ = "q" THEN RETURN
'load attrubiues from text
OPEN filename$ + ".dat" FOR INPUT AS #1
INPUT #1, currentfile$
INPUT #1, tag.BN
INPUT #1, tag.BS
INPUT #1, tag.BE
INPUT #1, tag.BW
INPUT #1, tag.D
INPUT #1, tag.S
CLOSE
GOSUB tagapply
'load graphic
DEF SEG = VARSEG(im(1))
[glow=red,2,300]BLOAD filename$, VARPTR(im(1))[/glow]
DEF SEG = VARSEG(a(0))
PUT (101, 101), im, OR
'set filename
filename$ = ""
RETURN
the glowing statment has the problem
please help i have no idea whats wrong...
I have been trying to write an QBASIC Art editing program for a game i am making. It needs to store an image as well as a text file that stores sertain attruibutes of that tile.
Now when I create a tile and save it.
Then create a new tile
Then load it again
it works fine
BUT
When i RESTART the program and try to load the previously saved file, QBASIC performs and illeagal operation. THIS HAPPENS EXACLY AT the BLOAD statement.
Here is my code:
savetile:
'Get filename
INPUT "SAVE AS"; filename$: IF filename$ = "q" THEN RETURN
'Save attributes to text file
OPEN filename$ + ".dat" FOR OUTPUT AS #1
PRINT #1, filename$
PRINT #1, tag.BN
PRINT #1, tag.BS
PRINT #1, tag.BE
PRINT #1, tag.BW
PRINT #1, tag.D
PRINT #1, tag.S
CLOSE
'Save graphic
GET (101, 101)-(129, 129), im
DEF SEG = VARSEG(im(1))
BSAVE filename$, VARPTR(im(1)), 12000
DEF SEG = VARSEG(a(0))
'set filenames
currentfile$ = filename$ + " "
filename$ = ""
RETURN
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
loadtile:
'get filename
INPUT "LOAD"; filename$: IF filename$ = "q" THEN RETURN
'load attrubiues from text
OPEN filename$ + ".dat" FOR INPUT AS #1
INPUT #1, currentfile$
INPUT #1, tag.BN
INPUT #1, tag.BS
INPUT #1, tag.BE
INPUT #1, tag.BW
INPUT #1, tag.D
INPUT #1, tag.S
CLOSE
GOSUB tagapply
'load graphic
DEF SEG = VARSEG(im(1))
[glow=red,2,300]BLOAD filename$, VARPTR(im(1))[/glow]
DEF SEG = VARSEG(a(0))
PUT (101, 101), im, OR
'set filename
filename$ = ""
RETURN
the glowing statment has the problem
please help i have no idea whats wrong...