Changes

Jump to: navigation, search

Locomotive BASIC

4,478 bytes removed, 15:08, 31 January 2014
/* XPOS */
==== <code>XPOS</code> ====
 
: Returns the current horizontal (x) position of the graphics cursor.
 
==== <code>YPOS</code> ====: Returns the current vertical (y) position of the graphics cursor. ==== Error codes ====# '''Unexpected NEXT''' - <code>NEXT</code> encountered without matching <code>FOR</code>.# '''Syntax Error''' - Typing error or incorrect punctuation.# '''Unexpected RETURN''' - <code>RETURN</code> encountered when there was no active <code>GOSUB</code>.# '''DATA exhaused''' - Trying to <code>READ</code> data when data pointer has reached end of data.# '''Improper argument''' - The argument for a function is not legal (e.g. <code>PRINT SQR(-10)</code>).# '''Overflow''' - The computer cannot handle integers smaller than -32768 (signed) or larger than 65535 (unsigned) or floating point numbers greater than &plusmn;1.7E38.# '''Memory full''' - Not enough free RAM available to complete the operation. Program too big or control structures too deeply nested.# '''Line does not exist''' - Attempt to <code>RUN</code>, <code>GOTO</code> or <code>GOSUB</code> a non-existent line number.# '''Subscript out of range''' - Value of a subscript in an array is outside of range specified by <code>DIM</code> declaration or wrong number of dimensions supplied.# '''Array already dimensioned''' - Arrays can only be <code>DIM</code>ensioned once within a program.# '''Division by zero''' - Trying to divide a number by zero.# '''Invalid direct command''' - Using a statement as a direct command which is not allowed outside a program, e.g. <code>DEF FN</code>.# '''Type mismatch''' - Wrong data type encountered, string data instead of numeric value or vice versa.# '''String space full''' - String memory area is full.# '''String too long''' - String may not exceed 256 characters.# '''String expression too complex''' - A string expression needs to be broken down into smaller expressions.# '''Cannot CONTinue''' - <code>CONT</code> can only be used if program was stopped by [ESC] or a <code>STOP</code> in program - not after END. If the program is modified before issuing <code>CONT</code> you will also get this error.# '''Unknown user function''' - A <code>DEF FN</code> must be executed before calling an <code>FN</code> function.# '''RESUME missing''' - End of program has been reached while in error processing mode. Use <code>ON ERROR GOTO</code> before <code>RESUME</code>.# '''Unexpected RESUME''' - <code>RESUME</code> is only used in error processing mode, <code>ON ERROR GOTO</code> statement must be used first.# '''Direct Command found''' - A line without a line number has found while loading a file.# '''Operand missing''' - An incomplete expression has been found.# '''Line too long''' - The line contains too many statements.# '''EOF met''' - Trying to input data beyond end of data file.# '''FILE type error''' - Using a program file instead of a data file to read or write (or vice versa).# '''NEXT missing''' - The <code>NEXT</code> of a <code>FOR</code> ... <code>NEXT</code> loop is missing.# '''File already open''' - Trying to open an open file. Use <code>CLOSEIN</code> or <code>CLOSEOUT</code> first.# '''Unknown command''' - Given when an unknown command follows a <code>|</code>. e.g. <code>|DISC</code> on a CPC464 without AMSDOS installed.# '''WEND missing''' - The <code>WEND</code> part of the <code>WHILE</code> ... <code>WEND</code> loop is missing.# '''Unexpected WEND''' - <code>WEND</code> encountered without a corresponding active <code>WHILE</code>.# '''File not open''' - Attempting to read from or write to a file without <code>OPEN</code>ing it first.# '''Broken in''' - During handling with files (read, write, change etc.) different problems could appear. BASIC reacts with Error code 32 due to it. You have to mask the DERR code with AND &7F (mask Bit 7) and compare the result with the following table to get explained what happened:Decimal (binary) number: 14 (0000 1110) > Stream in an unclear condition15 (0000 1111) > reached End of File (hard eof)16 (0001 0000) > unknown command or filename17 (0001 0001) > there's already a file existing with the same name18 (0001 0010) > there's no file with that name19 (0001 0011) > full directory20 (0001 0100) > full disc21 (0001 0101) > disc was removed during reading22 (0001 0110) > only readable26 (0001 1010) > reached End of File (soft end)Does AMSDOS has already given out a failure then Bit 7 will be set. That means add 128 decimal to DERR code.* '''Unknown error''' - Executing <code>ERROR</code> command with any other legal error code number (up to 255).
== Other Basic Dialects available for the CPC ==
205
edits