
Button 1 Label Open_Folder
Button 3 Label Write_File
Button 4 Label Read_File

Button 7 Label Select_File

Button 9 Label Test_CmdExe

' -------------------------------------- WARNING - THE PATH 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 100
		s1 = Now
		s1 = s1 + "   "
		s1 = s1 + " Random number = "
		s1 = s1 + Format(Rnd * 100, "0")
		Print s1 + CRLF
		Save StringToFile s1 FilePathAndName
	Next
Return

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

Label Select_File
	Controls ClearTextBox
	Print SelectFile(FolderName)
Return

Label Test_CmdExe
	Load "C:\Windows\System32\Cmd.Exe"
	Wait Seconds 0.1
	SendKeys "systeminfo{ENTER}"
Return


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