#COMPILE EXE "s59_file_write.exe"
' Sample: Write text to file using file handle
FUNCTION PBMAIN() AS LONG
    PRINT "Opening sample_output.txt for writing..."
    OPEN "sample_output.txt" FOR OUTPUT AS #1
    PRINT #1, "Line 1: Hello from PBXA64"
    PRINT #1, "Line 2: Numbers 1 2 3"
    PRINT #1, "Line 3: End of file"
    CLOSE #1
    PRINT "File written successfully"
    FUNCTION = 0
END FUNCTION
