Writing text to a file

Blitz3D Forums/Blitz3D Beginners Area/Writing text to a file

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.

This came from the help file
; Reading and writing a file using ReadLine$ and WriteLine functions 

; Initialise some variables for the example 
String1$ = "Line 1 is short" 
String2$ = "Line 2 is a longer line but they can be much longer" 
String3$ = "Line 3 is made up " 
String4$ = "of two parts joined together." 

; Open a file to write to 
fileout = WriteFile("c:\mydata.txt") 

; Write the information to the file 
WriteLine( fileout, String1 ) 
WriteLine( fileout, String2 ) 
WriteLine( fileout, String3 + String4) 
WriteLine( fileout, "Just to show you don't have to use variables" ) 

; Close the file 
CloseFile( fileout ) 

End