Changes

Jump to: navigation, search

Locomotive BASIC

173 bytes added, 22:37, 30 December 2018
/* Functions */
==== <code>BIN$ (i1,[i2])</code> ====
: FUNCTION: Produces a string of BINary digits respresenting the value of the <unsigned integer expression>, using the number of binary digits instruced by the second <integer expression> (in the range of 0 to 16). If the number of digits instructed is too great, the resulting expression will be filled with leading zeros; if the number of digits instructed is too small, the resulting expression will NOT be shortened to the instructed number of digits, but will produced in as many digits as are required.
: The <unsigned integer expression> to be converted into binary form must yield a value in the range -32768 to 65535.
: Associated keywords: DEC$, HEX$, STR$
: Example:
==== <code>CHR$ (n)</code> ====
: Returns FUNCTION: Converts an <integer expression> in the range 0 to 255, to its CHaRacter $tring equivalent, using the AMSTRAD character for a given index nset shown in the ASCII table or e. For instance g. in the manual part 3.: Note that 0 to 31 are control characters; hence the below example prints CHR$(65x) returns in the character 'A'. Valid indices range from 0 (zero) 32 to 255.
: As an Example<pre>10 FOR X=32 to 25520 PRINT X;CHR$(X);30 NEXT</pre> : A further example, try the following basic program :
<pre>10 print chr$(208+rnd(2));:goto 10</pre>
: It will draw a random maze with characters 208 and 209, which are an horizontal and a vertical bar.
::The CHR$ code between 0 and 31 will not print out a character but perform a functionControl Codes Table:
<pre>
===============================================================================
205
edits