Changes

Jump to: navigation, search

Locomotive BASIC

963 bytes added, 12:42, 15 January 2019
/* Functions */
run
</pre>
==== <code><big>INT (n<numeric expression>)</big></code> ====
: ''BASIC 1.0 & 1.1''
: '''FUNCTION''': Rounds the number to the nearest smaller INTeger, removing any fractional part. Returns then same value as FIX for positive number, but returns one less than FIX for negative numbers which are not already integers.
3 -4
</pre>
==== <code><big>JOY (i<integer expression>)</big></code> ====: ''BASIC 1.0 & 1.1'': Returns '''FUNCTION''': The JOY function reads a bit-significant value result from specified the joystick. i = in the <integer expression> (either 0 or 1).
<pre>
================================|Bit | Value returneddecimal |================================|0(up) | 1 ||1(down) | 2 ||2(left) | 4 ||3(right) | 8 ||4(fire 2) | 16 ||5(fire 1) | 32 |================================
</pre>
==== <code><big>LEFT$ (<string expression>, <required length>)</big></code> ====
: ''BASIC 1.0 & 1.1''
: FUNCTION: Returns the number of characters (in the range 0 to 255) specified in the <required length> parameter (<integer expression>), after extracting them from the LEFT of the <string expression>. If the <string expression> is shorter than the <required length>, the whole <string expression> is returned.
==== <code>LEFT$ (se, i)</code> ==== : Returns a substring of se. The substring begins at the left-most character of se and contains i characters. : Example'''Associated keywords''':MID$, RIGHT$
: '''1. Example''':
<pre>
A$="ABCDEFG":PRINT LEFT$(A$,3) - prints ABC
</pre>
: '''2. Example''':
<pre>
10 CLS
20 a$="AMSTRAD"
30 FOR n=1 to 7
40 PRINT LEFT$(a$,n)
50 NEXT
run
</pre>
==== <code><big>LEN (<string expression>)</big></code> ====
: ''BASIC 1.0 & 1.1''
: '''FUNCTION''': Returns the total number of characters (i.e. the LENgth) of the <string expression>.
==== <code>LEN (se)</code> ==== : Returns the number of characters in se (0 - 255)'''Associated keywords''': none
: '''Example''':
<pre>
10 LINE INPUT "Enter a phrase";a$
20 PRINT "The phrase is";
30 PRINT LEN(a$);"characters long."
run
</pre>
==== <code>LOG (n)</code> ====
205
edits