Previous Top Index Next

External Console I/O Functions (DOS)

The following routines are available after loading the library file conio.r with the command: CALL import "conio.r".

CLS()

Clear Screen through INT 10h call.
CALL cls

EOLINE()

Clear from cursor position until End of Line (ANSI Call)
CALL eoline

SETMODE(mode)

Set the current video Mode. Look at BIOS manual for available modes.
CALL setmode 3 /* Switch to normal 80x25 color */
CALL setmode 1 /* Switch to 40x25 color */

GETMODE()

Returns the current video mode.
SAY getmode() /* Probably 3 */

GOTOXY(x,y)

Position cursor in the screen
CALL gotoxy 0,20 /* Goto to begining of line 20 */

WHEREXY()

Returns the current position of the cursor.
SAY wherexy() /* maybe: "20 5" */
PARSE VALUE wherexy() WITH X Y /* maybe: X=20 Y=5 */

WHEREX()

Returns the current column position of the cursor.
SAY wherex() /* maybe: "20" */

WHEREY()

Returns the current row position of the cursor.
SAY wherey() /* maybe: "5" */

PUTPIXEL(x,y,c)

Set the pixel color to c at position x,y Valid only in graphics modes.
CALL putpixel 10,10,15

GETPIXEL(x,y)

Get the pixel color at position x,y Valid only in graphics modes.
SAY getpixel(10,10) /* maybe 15 */

GETCH()

Waits for a key to be pressed and returns the character. If a special character is pressed, then it returns the scan code in HEX.
SAY getch() /* maybe 'a' */
SAY getch() /* maybe '01' */

GETCHE()

Same as the GETCH but echos also the character to screen.

KBHIT()

Returns '1' if a character is waiting in the keyboard buffer, else returns '0'


Previous Top Index Next