mirror of
https://github.com/inexorabletash/jsbasic.git
synced 2025-01-17 23:31:06 +00:00
Invalid DOS commands should fail with Syntax Error. Resolves #13
This commit is contained in:
parent
7b7a5e4a6b
commit
78428020d8
7
dos.js
7
dos.js
@ -21,7 +21,10 @@ function DOS(tty) {
|
|||||||
NO_BUFFERS_AVAILABLE: [12, 'No buffers available'],
|
NO_BUFFERS_AVAILABLE: [12, 'No buffers available'],
|
||||||
FILE_TYPE_MISMATCH: [13, 'File type mismatch'],
|
FILE_TYPE_MISMATCH: [13, 'File type mismatch'],
|
||||||
PROGRAM_TOO_LARGE: [14, 'Program too large'],
|
PROGRAM_TOO_LARGE: [14, 'Program too large'],
|
||||||
NOT_DIRECT_COMMAND: [15, 'Not direct command']
|
NOT_DIRECT_COMMAND: [15, 'Not direct command'],
|
||||||
|
|
||||||
|
// Re-used
|
||||||
|
SYNTAX_ERROR: [16, "Syntax error"]
|
||||||
},
|
},
|
||||||
|
|
||||||
STORAGE_PREFIX = 'vfs/',
|
STORAGE_PREFIX = 'vfs/',
|
||||||
@ -368,7 +371,7 @@ function DOS(tty) {
|
|||||||
activebuffer = null;
|
activebuffer = null;
|
||||||
mode = "";
|
mode = "";
|
||||||
} else {
|
} else {
|
||||||
doserror(DOSErrors.INVALID_OPTION);
|
doserror(DOSErrors.SYNTAX_ERROR);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -881,7 +881,7 @@
|
|||||||
18091 T = 1
|
18091 T = 1
|
||||||
18093 S = (T = 2) : GOSUB 1
|
18093 S = (T = 2) : GOSUB 1
|
||||||
|
|
||||||
18100 T$ = "Output Hook Precedence
|
18100 T$ = "Output Hook Precedence"
|
||||||
: A$ = "abc" + CHR$(7) + "xyz"
|
: A$ = "abc" + CHR$(7) + "xyz"
|
||||||
: PRINT CHR$(4)"OPEN TESTDATA"
|
: PRINT CHR$(4)"OPEN TESTDATA"
|
||||||
: PRINT CHR$(4)"WRITE TESTDATA"
|
: PRINT CHR$(4)"WRITE TESTDATA"
|
||||||
@ -893,6 +893,12 @@
|
|||||||
: PRINT CHR$(4)"CLOSE TESTDATA"
|
: PRINT CHR$(4)"CLOSE TESTDATA"
|
||||||
: S = (A$ = B$) : GOSUB 1
|
: S = (A$ = B$) : GOSUB 1
|
||||||
|
|
||||||
|
18110 T$ = "Invalid DOS Command"
|
||||||
|
: T = 1 : ONERR GOTO 18112
|
||||||
|
18111 PRINT CHR$(4);CHR$(5)
|
||||||
|
: T = 2
|
||||||
|
18112 S = (T=1) AND (PEEK(222)=16) : GOSUB 1
|
||||||
|
|
||||||
20000 PRINT : PRINT : PRINT "Executed tests: "; TE
|
20000 PRINT : PRINT : PRINT "Executed tests: "; TE
|
||||||
20010 PRINT "Successful tests: "; TS
|
20010 PRINT "Successful tests: "; TS
|
||||||
20019 IF F THEN INVERSE
|
20019 IF F THEN INVERSE
|
||||||
|
Loading…
x
Reference in New Issue
Block a user