I can't get this to read a string Correctly> No matter what I do it will not read x$ as "Howard". Please tell me how to do this because my whole program revolves around reading & writing files?
Global x$ = ""
Global y = 0
Global z# = 0
A$= SaveGame(1)
B$=LoadGame(1)
WaitKey()
End
Function SaveGame(a)
;set up the screen
Cls
Locate 0,0
;let user choose what to save game as
filesave = Input("Save game as - ")
filesave = filesave + ".dat"
;write files to dat file
fileout = WriteFile(filesave)
x$ = "Howard"
y = 880091
z# = 11.9
;enter any other variables included in any games here.
WriteInt(fileout,x$)
WriteInt(fileout,y)
WriteInt(fileout,z#)
;for extra variables, use "WriteInt," "WriteString," and "WriteByte" accordingly.
;close file
CloseFile(fileout)
x$ = ""
y = 0
z# = 0
End Function
Global x$ = ""
Global y = 0
Global z# = 0
A$= SaveGame(1)
B$=LoadGame(1)
WaitKey()
End
Function SaveGame(a)
;set up the screen
Cls
Locate 0,0
;let user choose what to save game as
filesave = Input("Save game as - ")
filesave = filesave + ".dat"
;write files to dat file
fileout = WriteFile(filesave)
x$ = "Howard"
y = 880091
z# = 11.9
;enter any other variables included in any games here.
WriteInt(fileout,x$)
WriteInt(fileout,y)
WriteInt(fileout,z#)
;for extra variables, use "WriteInt," "WriteString," and "WriteByte" accordingly.
;close file
CloseFile(fileout)
x$ = ""
y = 0
z# = 0
End Function