HTBasic Help
×
Menu
Index

ASSIGN Example

10    ON ERROR GOTO 50
20    CLEAR SCREEN
30    PRINT "*** output TEST ****"
40    PURGE "test.txt"
50    CREATE "test.txt",0
60    ASSIGN @File TO "test.txt";FORMAT ON
70    A$="This is a test."
80    OUTPUT @File;A$
90    RESET @File
100   ENTER @File;Test$
110   ASSIGN @File TO *
120   IF A$=Test$ THEN
130     PRINT "Test passed."
140     PURGE "test.txt"
150   ELSE
160     PRINT "Test failed."
170     PRINT "Output string did not equal input string."
180   END IF
190   END