[Return to top]

EhBASIC68 language reference by Lee Davison
[Back]


Introduction

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.

ELLIPSE ELLIPSEF FILL LINE LOAD MODE MOVE
POINT POINT() RECT RECTF SAVE SIZE TI

BASIC Commands

ELLIPSE [<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 possibly the fill colour, will be set.

ELLIPSEF [<exprX1>,<exprY1>,<exprX2>,<exprY2>][,][<exprLC>[,<exprFC>]]
The same as ELLIPSE except the ellipse is filled with the current fill colour.
FILL [<exprX>,<exprY>][,][<exprFC>]
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 fill colour will be set to that value before the fill starts. Also just giving <exprFC> will set the fill colour without drawing.

LINE [<exprX1>,<exprY1>[,<exprX2>,<exprY2>]][,][<exprLC>]
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.

LOAD <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 also merged with any program lines currently in the memory.

Binary loading is much faster and over writes any program currently in memory.

MODE <expression>
Set the draw mode to <expression>. Valid values are 0 to 15.

Mode Function Effect
0False Drawing is always black
1True Drawing is always white
2Null Nothing is drawn but the cursor is moved
3Inverse The inverse of the background is drawn
4Colour The colour is drawn
5Inverse colour The inverse of the colour is drawn
6Inverse OR The inverse of the background OR the colour is drawn
7Inverse AND The inverse of the background AND the colour is drawn
8OR Inverse The background OR the inverse of the colour is drawn
9AND Inverse The background AND the inverse of the colour is drawn
10OR The background OR the colour is drawn
11NOR The background NOR the colour is drawn
12AND The background AND the colour is drawn
13NAND The background NAND the colour is drawn
14EOR The background ExclusiveOR the colour is drawn
15ENOR The background ExclusiveNOR the colour is drawn
MOVE <exprX>,<exprY>
Move the current graphics point to <exprX>,<exprY>. Nothing is drawn.
POINT <exprX>,<exprY>[,<exprLC>]
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.

RECT [<exprX1>,<exprY1>,<exprX2>,<exprY2>][,][<exprLC>[,<exprFC>]]
The same as ELLIPSE except the bounding rectangle itself is drawn.
RECTF [<exprX1>,<exprY1>,<exprX2>,<exprY2>][,][<exprLC>[,<exprFC>]]
The same as RECT except the bounding rectangle is filled with the current fill colour.
SAVE <expression$>[,a[n1][-n2]]
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.
SIZE <expression>
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.

BASIC Functions

POINT(<exprX>,<exprY>)

Returns the pixel colour value at point <exprX>,<exprY>.
TI
Returns the time since midnight in 1/100ths of seconds.

e-mail me [e-mail]
Last page update: 25th April, 2003.