Changes

Locomotive BASIC

928 bytes added, Thursday at 13:05
/* SAVE "filename" [,filetype][,paramter1,parameter2,parameter3] */
The CPC implementation of Locomotive BASIC was developed directly from [[Locomotive Software]]'s existing Z80 BASIC. The existence of this is cited as one of the reasons Locomotive requested that [[Amstrad]] change the CPC's processor from a 6502 to a [[Z80]].
The 464 (and some Spanish 472) shipped with BASIC 1.0 on ROM.
The language was revised and debugged for the 472(British), 664, 6128 and Plus machines to become BASIC 1.1. Changes were minor but significant for the programmer, and included:
* DEC$ bug removed (in BASIC 1.0, it required two opening brackets and was undocumented)
== Variables ==
Many contemporary BASIC interpreters only supported the first few characters of a variable name as a discriminator. For example <code>WATER$</code> and <code>WALDO$</code> would refer to the same variable on a Commodore 64 or Apple II. But Locomotive BASIC allowed variable names up to 40 characters in length, so <code>THEQUICKBROWNFOXJUMPEDOVERTHELAZYDOGFAST$</code> and <code>THEQUICKBROWNFOXJUMPEDOVERTHELAZYDOGFATS$</code> could be use as separate variables.
=== Real (Floating Point) Numbers ===
==== <code>CAT</code> ====
: Displays the names of the files on the tape or disc. Tape files are displayed in the order they are encountered. Disc files are sorted alphabetically by ACSII ASCII code. Only files matching the current user are displayed. Files marked as system are not displayed.
: Examples:
<pre>CAT :REM lists all disc files in alpha-numeric (ASCII) order</pre>
==== <code>OPENOUT ‹filename›</code> ====
: Opens the specified data file for writing. It writes an ASCII file. (To close The command <code>CLOSEOUT</code> finishes writing use to the command closeinfile and closes it cleanly.): Write to the file with PRINT#9.: No file is likely to be written until enough data is written (e.g. 2KB) or the file has at least 1 byte written and CLOSEOUT is used.: The following code pattern can be used to set MEMORY and lower HIMEM lower than would normally be allowed. This is often seen in disc loaders. This doesn't cause any file to be written: OPENOUT"<filename> MEMORY address CLOSEOUT
==== <code>ORIGIN x,y[,l,r,t,b]</code> ====
</pre>
==== <code>SAVE "filename" [,filetype][,paramter1parameter1,parameter2,parameter3]</code> ====
: Command saves the current BASIC program / content from RAM onto a storage medium (e.g. Tape, Disc)
20 b=&x1111:REM 15 binary
30 c$="***"
40 PRINT c$+SRSTR$(a+b)+c$
run
*** 270***
</pre>
 
==== <code><big>STRING$ (<length>,<character specifier>)</big></code> ====
: ''BASIC 1.0 & 1.1''
2,636
edits