Implement DATE$/TIME$/TIMER, FILES, SHELL, CHDIR, MKDIR, RMDIR

DATE$, TIME$, and TIMER now return real system date/time instead of
hardcoded values. Added directory and shell access statements with
proper GW-BASIC error codes (Path not found 76, File already exists 60).

Bump to v0.6.0, 52 tests.
This commit is contained in:
Eremey Valetov
2026-02-22 12:40:18 -05:00
parent ad21350003
commit ece018d06a
9 changed files with 188 additions and 7 deletions
+15
View File
@@ -0,0 +1,15 @@
10 REM DATE$, TIME$, TIMER test
20 D$ = DATE$
30 T$ = TIME$
40 R = TIMER
50 IF LEN(D$) <> 10 THEN PRINT "FAIL date len": END
60 IF MID$(D$,3,1) <> "-" THEN PRINT "FAIL date sep1": END
70 IF MID$(D$,6,1) <> "-" THEN PRINT "FAIL date sep2": END
80 IF LEN(T$) <> 8 THEN PRINT "FAIL time len": END
90 IF MID$(T$,3,1) <> ":" THEN PRINT "FAIL time sep1": END
100 IF MID$(T$,6,1) <> ":" THEN PRINT "FAIL time sep2": END
110 IF R < 0 OR R > 86400 THEN PRINT "FAIL timer range": END
120 PRINT "DATE$ = "; D$
130 PRINT "TIME$ = "; T$
140 PRINT "TIMER ="; INT(R)
150 PRINT "All date/time tests passed"
+11
View File
@@ -0,0 +1,11 @@
10 REM FILES, MKDIR, CHDIR, RMDIR test
20 MKDIR "gwb_test_dir"
30 OPEN "gwb_test_dir/test.txt" FOR OUTPUT AS #1
40 PRINT #1, "hello"
50 CLOSE #1
60 CHDIR "gwb_test_dir"
70 SHELL "pwd > /dev/null"
80 CHDIR ".."
90 KILL "gwb_test_dir/test.txt"
100 RMDIR "gwb_test_dir"
110 PRINT "All filesystem tests passed"