Help

Blitz3D Forums/Blitz3D Programming/Help

The forum is locked. These are the original blitzbasic.com forums, kept so they can still be read. No new topics, replies or edits can be made here. To join in, head over to the Blitz3D+ forums.

Can somebody tell me and/or fix this code so it will not say 'Stream does not exist'. This writes a file called '(your file name).inf' and a file called '(your file name).log'
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;LogFile.bb
;Contains Functions to write .log files
;WARNING:
;You must create a Global called 'LogName$' For these to work
;Call Function SetLogName() first unless you have declared it in the program start up
;Call Function WriteLogFile() second unless you already have the file written
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

Function WriteLog(St$)

file = ReadFile(FileName$ + ".inf")

LogName$ = ReadString$(file)

CloseFile(file)

file = OpenFile(LogName$)

WriteString(file,st$)

CloseFile(file)

End Function

Function WriteLogFile(FileName$)

file = ReadFile(FileName$ + ".inf")

LogName$ = ReadString$(file)

CloseFile(file)

file = WriteFile(LogName$)

CloseFile(file)

End Function

Function SetLogName(File$)

file = WriteFile(FileName$ + ".inf")

WriteString(file,FileName$ + ".log")

End Function

File 2:
Include "LogFile.bb" ;That is the name of the file above
SetLogName("example")
WriteLogFile("example")
WriteLog("Hello")

Thanks
I have figured it out.