CBASIC in General CBASIC Compile-Time Toggled Options Compiler Error Messages Run-Time Error Messages -- Warnings Run-Time Error Messages -- Error Codes CBASIC Reserved Words :CBASIC: CBASIC in General CBASIà i compile BASI whic ma b execute o an flopp dis base CP/ syste havin a leas 20 byte o memory I orde t mak th bes us o th powe an flexibilit o CBASIC dua flopp dis syste an a leas 32 o memor i recommended I CBASI i execute in a system smaller than 20K, a CP/M LOAD ERROR may occur. Th CBASI syste consist o tw program -- CBASI an CRUN CBASI i th compiler an CRU i th run-tim intepreter I typica CBASI session th use wil writ th progra usin ED compil i usin CBASI (with the $B option to suppress listing), and run it using CRUN. Refer to the 84-page CBASIC manual -- C B A S I C A Commercially Oriented Compiler/Interpreter BASIC Language Facility for CP/M Systems February 17, 1978 :CBASIC: CBASIC Compile-Time Toggled Options Compile toggle ar serie o switche tha ca b se whe th compile i executed Th toggle ar se b typin dollar-sig ($ followe b th lette designation o th desire toggle startin on spac o mor afte th progra nam o th comman line Toggle ma onl be set for the compiler. Examples of compiler toggles and invocation forms are -- CBASIC INVENTRY $BGF B:CBASIC A:COMPARE $GEC CBASIC PAYROLL $B CBASIC B:VALIDATE $E CBASIC Compiler Toggles TOGGL B Suppresse th listin o th progra o th consol durin compilation I a erro i detected th sourc lin wit th erro an th erro messag wil b printe eve i Toggl i set Toggl doe not affect listing to the printer (Toggle F) or disk file (Toggle G). Toggle B is initially off. TOGGLŠ C Suppresse th generatio o a IN file Engagin thi toggl wil provid synta chec withou th overhea o writin th intermediat file. Toggle C is initially off. TOGGL D Suppresse translatio o lower-cas letter t upper-case Fo example i Toggl i on 'AMT wil no refe t th sam variabl as 'amt'. Toggle D is initially off. TOGGLŠ E Cause th run-tim progra (CRUN t accompan an erro message wit th CBASI lin numbe i whic th erro occurred Toggl mus b se i orde fo th TRAC optio (se sectio 13. o th manual to work. Toggle E is initially off. TOGGLŠ F Cause th compile outpu listin t b printe o th LST: device in addition to the system console. Toggle F is initially off. TOGGLŠ G Cause th compile outpu listin t b writte t diskette Th fil containin th compile listin ha th sam nam a the .BAS file, but its type is .LST. Toggle G is initially off. :CBASIC: Compiler Error Messages Text Messages NO SOURCE FILE: .BAS Th compile coul no locat sourc fil use i eithe CBASI command or an INCLUDE directive. PROGRAM CONTAINS n UNMATCHED FOR STATEMENT(S) There are n FOR statements for which a NEXT could not be found. PROGRAM CONTAINS n UNMATCHED WHILE STATEMENT(S) There are n WHILE statements for which a WEND could not be found. WARNING: INVALID CHARACTER IGNORED Th previou lin contain a invali ASCI character thi characte is ignored by the compiler, and a question mark is printed in its place. 2-Letter Error Codes CE -- Close Error The intermediate (.INT) file could not be closed. DE -- Disk Error A disk error occurred while trying to read the .BAS file. DF -- Disk Full Ther wa n spac o th dis o th dis director wa full Th .INT file was not created. DL -- Duplicate Line number Th sam lin numbe wa use o tw differen lines Othe compile error ma caus D erro messag t b printe eve i duplicat lin numbers do not exist. DP -- Defined Previously A variable in a DIM statement was previously defined. EF -- Exponential Format numbe i exponentia forma wa inpu wit n digit followin th E. FD -- Function Definition functio nam tha ha bee previousl define i bein redefine i a DEF statement. FI -- FOR Index A expressio whic i no a unsubscripte numeri variabl i bein used as a FOR loop index. FN -- Function parameter Number A function reference contains an incorrect number of parameters. FP -- Function Parameter type functio referenc paramete typ doe no matc th paramete typ used in the function's DEF statement. FU -- Function Undefined A function has been referenced before it has been defined. IE -- IF Expression A expressio use immediatel followin a IƠ evaluate t typ string. Only type numeric is permitted. IF -- In File variabl use i FIL statemen i o typ numeri wher typ string is required. IP -- Input Prompt An input prompt string is not surrounded by quotes. IS -- Invalid Subscript A subscripted variable was referenced before it was dimensioned. IU -- Invalid Use A variable defined as an array is used with no subscripts. MF -- Mixed Format An expression evaluates to type string when type numeric is required. MM -- Mixed Mode Variable o typ strin an typ numeri ar combine i th sam expression. NI -- NEXT Index variabl reference b NEX statemen doe no matc th variabl referenced by the associated FOR statement. NU -- NEXT Unexpected A NEXT statement occurs without an associated FOR statement. OO -- ON Overflow More than 25 ON statements were used in the program. SE -- Syntax Error The source line contains a syntax error. SN -- Subscript Number A subscripted variable contains an incorrect number of subscripts. SO -- Syntax Overflow Th expressio i to comple an shoul b simplifie an place o more than one line. TO -- Table Overflow Th progra i to larg fo th system Th progra mus b simplified or the system size increased. UL -- Undefined Line number A line number that does not exist has been referenced. US -- Undefined String A string has been terminated by a carriage return rather than quotes. VO -- Variable Overflow Variable names are too long for one statement. This should not occur. WE -- WHILE Error The expression immediately following a WHILE statement is not numeric. WU -- WHILE Undefined A WEND statement occurs without an associated WHILE statement. :CBASIC: Run-Time Error Messages -- Warnings Tw textua run-tim erro message ar presente b CRUN: NO INTERMEDIATE FILE fil nam wa no specifie wit th CRU command o n fil o typ .IN an th specifie fil nam wa foun o disk. IMPROPER INPUT - REENTER Thi messag occur whe th field entere fro th consol d no matc th fiel specifie i th INPU statement Thi ca occu whe fiel type d no matc o th numbe o field entere i differen fro th numbe o field specified Al field specifie b th INPU statemen mus b reentered. 2-Letter Warning Codes DZ -- Divide by Zero numbe wa divide b zero Th resul i se t th larges vali CBASI number. FL -- Field Length fiel lengt greate tha 25 byte wa encountere durin REA LINE Onl th firs 25 character o th recor ar retained. LN -- Logarithm error Th argumen give i th LO functio wa zer o negative Th valu o th argumen i returned. NE -- NEgative number negativ numbe wa specifie followin th rais t powe operato (^) Th absolut valu i use i th calculation. OF -- OverFlow calculatio produce numbe to large Th resul i se o th larges vali CBASI number. SQ -- SQuare root error negativ numbe wa specifie i th SQ function Th absolut valu i used. :CBASIC: Run-Time Error Messages -- Error Codes AC -- AsCii error Th strin use a th argumen i a AS functio evaluate t nul string. CE -- Close Error An error occurred upon closing a file. CU -- Close Undefined file clos statemen specifie fil numbe tha wa no active. DF -- Defined File A OPE o CREAT wa specifie wit fil numbe tha wa alread active. DU -- Delete Undefined file DELET statemen specifie fil numbe tha wa no active. DW -- Disk Write error A erro occurre whil writin t file Thi occur whe eithe th director o th dis i full. EF -- End of File rea pas th en o fil occurre o fil fo whic n IƠ EN statemen ha bee executed. ER -- Error in Record A attemp wa mad t writ recor o lengt greate tha th maximu recor siz specifie i th associate OPEN CREATE o FIL statement. FR -- File Rename A attemp wa mad t renam fil t a existin fil name. FU -- File Undefined A attemp wa mad t rea o writ t fil tha wa no active. IR -- Invalid Record number A record number less than one was specified. LW -- Line Width lin widt les tha o greate tha 13 wa specifie i a LPRINTE WIDT statement. ME -- MAKE Error A erro occurre whil creatin o extendin fil becaus th dis director wa full. MP -- MATCH Parameter Th thir paramete i MATC functio wa zer o negative. NF -- Number of FILE Th fil numbe specifie wa les tha o greate tha 20. NM -- No Memory There was insufficient memory to load the program. NN -- No Number field A attemp wa mad t prin numbe wit PRIN USIN statemen bu ther wa no numeri dat fiel i th USIN string. NS -- No String field A attemp wa mad t prin strin wit PRIN USIN statemen bu ther wa no strin fiel i th USIN string. OD -- Overflow Data REAĠ statemen wa execute wit n DAT available. OE -- OPEN Error A attemp wa mad t OPE fil tha didn' exis an fo whic n I EN statemen ha bee previousl executed. OI -- ON Index Th expressio specifie i a O .. GOSU o a OΠ .. GOT statemen evaluate t numbe les tha o greate tha th numbe o lin number containe i th statement. OM -- Overflow Memory The program ran out of memory during execution. QE -- Quote Error A attemp wa mad t PRIN t fil strin containin quotatio mark. RE -- READ Error A attemp wa mad t rea pas th en o recor i fixe file. RG -- RETURN with no GOSUB A RETURN occurred for which there was no GOSUB. RU -- Random Undefined rando rea o prin wa attempte t othe tha fixe file. SB -- SuBscript A arra subscrip wa use whic exceede th boundarie fo whic th arra wa defined. SL -- String Length concatenatio operatio resulte i strin o mor tha 25 bytes. SS -- SubString error Th secon paramete o MID functio wa zer o negative. TF -- Too many Files A attemp wa mad t hav mor tha 2 activ file simultaneously. TL -- TAB Length TA statemen containe paramete les tha o greate tha th curren lin width. UN -- UNdefined edit string PRIN USIN statemen wa execute wit nul edi string. WR -- WRite error A attemp wa mad t writ t fil afte i ha bee read bu befor i ha bee rea t th en o th file. :CBASIC: CBASIC Reserved Words CBASIC Reserved Words ABS EQ LEN POS STOP AND EXP LET PRINT STR$ AS FEND LINE RANDOMIZE SUB ASC FILE LOG READ TAB ATN FOR LPRINTER RECL TAN CALL FRE LT REM THEN CHR$ GE MATCH REMARK TO CLOSE GO MID$ RENAME USING CONSOLE GOSUB NE RESTORE VAL COS GOTO NEXT RETURN WEND CREATE GT NOT RIGHT$ WHILE DATA IF ON RND WIDTH DEF INP OPEN SGN XOR DELETE INPUT OR SIN DIM INT OUT SIZE ELSE LE PEEK SQR END LEFT$ POKE STEP