
Button 1 Label Open_Folder
Button 3 Label Write_File
Button 4 Label Write_File_ASCII

Button 6 Label Read_File
Button 7 Label Select_File

' --------------------------------------
'   WARNING - THE FOLDER MUST EXIST !
' --------------------------------------
Variable String FolderName = "C:\Temp\"

Variable String FilePathAndName = FolderName + "ExampleFile.txt"

Controls OpenTextBox
Controls ClearTextBox

Stop

Label Open_Folder
	Load FolderName
Return

Label Write_File
	Controls ClearTextBox
	Save DeleteFile FilePathAndName
	For v1 = 1 To 5
		s1 = Now
		s1 = s1 + "   "
		s1 = s1 + " Random number = "
		s1 = s1 + Format(Rnd * 100, "0")
		Print s1 + CRLF
		Save StringToFile s1 FilePathAndName
	Next
Return

Label Write_File_ASCII
	Controls ClearTextBox
	Save DeleteFile FilePathAndName
	For v1 = 1 To 5
		s1 = Now
		s1 = s1 + "   "
		s1 = s1 + " Random number = "
		s1 = s1 + Format(Rnd * 100, "0")
		Print s1 + CRLF
		s1 = "<ASCII>"+ s1
		Save StringToFile s1 FilePathAndName
	Next
Return

Label Read_File
	Controls ClearTextBox
	s1 = GetTextFile(FilePathAndName)
	Print s1
Return

Label Select_File
	Controls ClearTextBox
	s1 = SelectFile(FolderName)
	Print s1
Return


'WATCH v1
'WATCH s1
'WATCH Now
'WATCH Print Now
'WATCH Now
