Language reference. By Lee Davison. |
This language reference will only refer to those commands which differ from, or are in addition to, those in the main EhBASIC68 language reference.
Notes on graphic commands
Co-ordinates
In all instances X and Y co-ordinate values may vary from -32768 to +32767. Attempting to use values outside this range will cause a function call error. Only parts of a structure that appear within the visible window, (0,0) to (639,479), will be drawn.
Colour values
Colour values are longword integers and are interpreted as follows ..
Bits 31 to 24 Bits 23 to 16 Bits 15 to 8 Bits 7 to 0 Ignored Blue value Green value Red value As bits 31 to 24 are ignored -ve values may be used where convenient. E.g. you could use -1 instead of $FFFFFF for white.
BASIC Keywords
Here is a list of EASy68k BASIC keywords. Keywords are only valid when entered in upper case as shown, spaces may not be included in them. So, for example, GOTO would be a valid keyword but GO TO would not.
BUFFER CLS CURSOR ELLIPSE ELLIPSEF FILL KEYS() LINE LOAD MODE MOVE POINT POINT() RECT RECTF SAVE SIZE TI
BASIC Commands
BASIC FunctionsCLSCopies the screen buffer to the visible screen when double buffered mode is enabled. Has no effect if double buffered mode is not enabled. See MODE for how to set double buffered mode.
CURSOR <exprX>,<exprY>Clears the screen. When double buffered mode is enabled it clears the screen buffer.
ELLIPSE [<exprX1>,<exprY1>,<exprX2>,<exprY2>][,][<exprLC>[,<exprFC>]]Sets the position of the text cursor as defined by exprX and exprY.
Values must be 0 <= exprX <= 79 and 0 <= exprY <= 31. If either is outside this range it will cause a Function Call error.
ELLIPSEF [<exprX1>,<exprY1>,<exprX2>,<exprY2>][,][<exprLC>[,<exprFC>]]Draws an unfilled ellipse bounded by the rectangle defined by exprX1 and exprX2, for the X axis, and exprY1 and exprY2, for the Y axis, of colour exprLC. The width of the line used to draw the ellipse is set by the SIZE command.
If exprLC is present then the line colour will be set before the ellipse is drawn.
If exprFC is present then the fill colour will be set before the ellipse is drawn. If you want to set the fill colour then the line colour must also be set.
If the co-ordinates are omitted then only the line colour, and the fill colour if given, will be set without drawing.
FILL [<exprX>,<exprY>][,][<exprFC>]The same as ELLIPSE except the ellipse is filled with the current fill colour.
LINE [<exprX1>,<exprY1>[,<exprX2>,<exprY2>]][,][<exprLC>]Flood fill the area starting from <exprX>,<exprY>. The fill will continue until it reaches the screen edge or a pixel of a different colour to that originally at <exprX>,<exprY>.
If <exprFC> is specified then the current fill colour is set before the fill starts. If <exprX>,<exprY> is omitted and just <exprFC> is specified then the fill colour is set without drawing.
LOAD <expression$>Draws a line from <exprX1>,<exprY1> to <exprX2>,<exprY2>. If <exprX2>,<exprY2> is omitted then the line is drawn from the current graphics position to <exprX1>,<exprY1>.
If <exprLC> is specified then the line colour will be set to that value before the line is drawn. Also just giving <exprLC> will set the line colour without drawing.
MODE <expression>Attempts to load the file expression$. It will recognise the file format (binary or ASCII) and invoke the necessary routines.
During an ASCII load you will see the program as it is being read from the file. This file is merged with any program lines currently in the memory so to completely replace a program in memory NEW should be performed before LOAD.
Binary files load much faster and over write any program currently in memory but may not be readable by future versions.
MOVE <exprX>,<exprY>Set the draw mode to <expression>. Valid values are 0 to 17.
Mode Function Effect 0 False Drawing is always black 1 True Drawing is always white 2 Null Nothing is drawn but the cursor is moved 3 Inverse The inverse of the background is drawn 4 Colour The colour is drawn (default) 5 Inverse colour The inverse of the colour is drawn 6 Inverse OR The inverse of the background OR the colour is drawn 7 Inverse AND The inverse of the background AND the colour is drawn 8 OR Inverse The background OR the inverse of the colour is drawn 9 AND Inverse The background AND the inverse of the colour is drawn 10 OR The background OR the colour is drawn 11 NOR The background NOR the colour is drawn 12 AND The background AND the colour is drawn 13 NAND The background NAND the colour is drawn 14 EOR The background ExclusiveOR the colour is drawn 15 ENOR The background ExclusiveNOR the colour is drawn 16 Single Turn off double buffer mode (default) 17 Double Turn on double buffer mode POINT [<exprX>,<exprY>][,][<exprLC>]Move the current graphics point to <exprX>,<exprY>. Nothing is drawn.
RECT [<exprX1>,<exprY1>,<exprX2>,<exprY2>][,][<exprLC>[,<exprFC>]]Set the colour of the point <exprX>,<exprY> to the current line colour.
If <exprLC> is specified then the current line colour is set before the point is plotted. If <exprX>,<exprY> is omitted and just <exprLC> is specified then the line colour is set without drawing.
RECTF [<exprX1>,<exprY1>,<exprX2>,<exprY2>][,][<exprLC>[,<exprFC>]]The same as ELLIPSE except the bounding rectangle itself is drawn.
SAVE <expression$>[,a[n1][-n2]]The same as RECT except the bounding rectangle is filled with the current fill colour.
SIZE <expression>Attempts to save the program memory to the file expression$. If the command has the ,a appended then the program will be saved in ASCII format. If saving in ASCII format then the range of the save can be specified as with the LIST command.
A program saved as binary loads much faster however, it is not recomended for archiving as binary programs may not be readable by different versions of EhBASIC.
Sets the width of lines drawn using the LINE command and the width of the outlines drawn using any of the shape commands.
The valid range of <expression> is from 0 to 255 but setting a value of zero will actually give a width of one.
POINT(<exprX>,<exprY>)Returns the current state of up to four specified keys. <expression> can be either string or numeric, if it is numeric then each byte of it's value as a longword is one key code and the flag for that code is returned in the corresponding byte of the returned value.
If <expression> is string then the first four characters of the string are used to form a right justified test string and the flag for that code is returned in the corresponding byte of the returned value. Characters beyond the fourth character are ignored.
If <expression> is numeric zero or a null string then the scan code of the last key pressed is returned.
All letter keys correspond to the upper case form of that letter, all numeric keys on the top row correspond to their number. Other key codes are given in the table below.
Key Code Key Code Backspace $08 keypad 5 $0C Keypad Enter or Enter $0D Shift $10 Control $11 Alt $12 Pause $13 Caps Lock $14 Esc $1B Space $20 Keypad 9 or Page Up $21 Keypad 3 or Page Down $22 Keypad 1 or End $23 Keypad 7 or Home $24 Keypad 4 or Left Arrow $25 Keypad 8 or Up Arrow $26 Keypad 6 or Right Arrow $27 Keypad 2 or Down Arrow $28 Keypad 0 or Insert $2D Keypad . or Delete $2E Keypad * $6A Keypad + $6B Keypad - $6D Keypad / $6F F2 $71 F3 $73 F4 $74 F5 $75 F11 $7A F12 $7B Num Lock $90 Scroll Lock $91 ; $BA = $BB , $BC - $BD . $BE / $BF ` $C0 [ $DB \ $DC ] $DD ' $DE TIReturns the pixel colour value at point <exprX>,<exprY>.
Returns the time since midnight in 1/100ths of seconds.
Last page update: 17th August, 2005. | e-mail me |