93-0771 ext 289 & ! 20 ! & ! ERROR & ! & !A program to print error messages and error numbers. & !If the argument is a number, the program will print the error & !message. If the argument is not a number, it will print any & !error messages which have the indicated text. Since it does & !INSTR, it is not necessary to get the text exactly correct. & !If there is a comma in the text, then the program will regard & !it as a list of things to be matched. For example: & !ERROR DEVICE will cause several messages to be printed (?Bad & !directory for device, ?Account or device in use, and several & !others. However, ERROR DEVICE,ROOM would print only the & !error message "?No room for user on device." & ! 90 ON ERROR GOTO 9000 100 ! & !preliminaries & ! 200 ! & !get argument if necessary & ! 210 IF ARG$ = "" & THEN PRINT "Error number or message to match"; \ & INPUTLINE ARG$ \ & ARG$ = CVT$$(ARG$,4%+32%) 220 IF ARG$ = "" & THEN GOTO 32767 300 ! & !See if argument is a number & ! 310 ERROR% = VAL(ARG$) & !if error, resume at 500 400 ! & !No error, therefore a number & ! 410 Z$ = SYS( CHR$(6%) + CHR$(9%) + CHR$(ERROR%) ) 420 ERROR$ = RIGHT(Z$,3%) 430 PRINT 440 PRINT NUM1$(ERROR%);": ";ERROR$ 450 GOTO 32767 500 ! & !Error, so not a number & ! 510 GOSUB 2000 520 IF ARG$ = "" & THEN GOTO 200 & !if message couldn't be found the first time, let & !them try again 900 ! & !done & ! 990 GOTO 32767 1000 ! & ! & ! SUBROUTINE: preliminaries & ! & ! 1100 ! & !some constants & ! 1110 TRUE% = -1% \ & FALSE% = 0% 1120 BELL$ = CHR$(7%) 1990 RETURN 2000 ! & ! & ! SUBROUTINE: find and print matching error messages & ! & ! 2100 ! & !expand argument into list if needed & ! 2110 DIM MATCH$(20%) !this should be big enough 2120 M% = 0% 2130 COMMA% = INSTR(1%,ARG$,",") 2140 IF COMMA% = 0% & THEN M% = M% + 1% \ & MATCH$(M%) = ARG$ \ & NMATCH% = M% \ & GOTO 2200 2150 M% = M% + 1% 2160 MATCH$(M%) = LEFT(ARG$,COMMA%-1%) \ & ARG$ = RIGHT(ARG$,COMMA%+1%) 2170 GOTO 2130 2200 ! & !loop through error messages & ! 2210 FOR MSG% = 1% TO 255% 2220 ERROR$ = SYS( CHR$(6%) + CHR$(9%) + CHR$(MSG%) ) \ & ERROR$ = RIGHT(ERROR$,3%) \ & CERROR$ = CVT$$(ERROR$,32%) 2230 FOR M% = 1% TO NMATCH% 2240 IF INSTR(1%,CERROR$,MATCH$(M%)) = 0% THEN 2280 2250 NEXT M% 2260 PRINT NUM1$(MSG%);": ";ERROR$ 2270 FOUND% = 1% 2280 NEXT MSG% 2300 ! & !if none were found, say so & ! 2310 IF FOUND% = 0% & THEN PRINT BELL$;"There is no error message matching that description." \ & ARG$ = "" 2990 RETURN 9000 ! & ! & ! Error Routine & ! & ! 9200 ! & !Expected errors (by line number) & ! 9210 IF ERL = 310 THEN RESUME 500 !illegal number 9600 ! & !Expected errors (with no specific line number) & ! 9900 ! & !Unexpected errors & ! 9910 Z$ = SYS(CHR$(6%)+CHR$(9%)+CHR$(ERR)) 9920 ERROR$ = RIGHT(Z$,3%) 9930 PRINT " ***** Whoops! *****" \ & PRINT " "; ERROR$; " at line";ERL 9990 GOTO 32767 30000 ! & ! & ! CCL entry point & ! & ! 30100 ! & !is this the right program & ! 30110 ARG$ = SYS( CHR$(7%) ) 30120 IF LEFT(ARG$,5%) <> "ERROR" & THEN GOTO 32767 30200 ! & !get the argument & ! 30210 ARG$ = RIGHT(ARG$,6%) 30220 ARG$ = CVT$$(ARG$,2%+4%+32%) 30300 ! & !begin at begining & ! 30310 GOTO 10 32767 END ERROR BAS[.050021]ERROR .BAS[.050021]   X14|H [4;Ik(&'( k ߫H&P` \RrPP2PPzPP{PPPPP2P~\$\\TD 0D \~ hi) +\ ^( n ^( np\^txY\^ˀ\!kVk<\F˰<˴ˬ\VVkˤ1`@lP ABCDEFGHIJKLMNOPQRSTUVWXYZ$.?0123456789<@<SЬTЬ UQS>