I'm on the move and will be for a while so won't be able to find out myself for a while. This code should reveal the answer though..
Code: Select all
Procedure Callback(Status, Filename$, File, SizeRead)
Select Status
Case #PB_Status_Saved
; File correctly saved
Debug "file saved"
Case #PB_Status_Error
; File saving has failed
Debug "file save error"
Case #PB_Status_Loaded
;read out the file in to the debug window
Debug "file loaded now reading lines..."
While Eof(0)=0
Debug ReadString(0)
Wend
EndSelect
EndProcedure
If Not OpenFile(0,"Text.txt",@Callback(),#PB_LocalStorage)
If CreateFile(0, "Text.txt", @Callback(),#PB_LocalStorage) ; we create a new text file
For a=1 To 10
WriteStringN(0, "Line "+Str(a)) ; we write 10 lines (each with 'end of line' character)
Next
For a=1 To 10
WriteString(0, "String"+Str(a)) ; and now we add 10 more strings on the same line (because there is no 'end of line' character)
Next
CloseFile(0)
EndIf
Else
CloseFile(0)
EndIf