EPOC logo Left Right Up
14 Overview

14 Overview


Chapter Contents


Introduction

Keywords can be subdivided into functions, which return a value, and commands, which do not. In practice you use functions and commands together, often using functions as if they were commands, ignoring the values they return.

This chapter lists all the keywords, grouped according to their purpose. Use this chapter if you know what you’d like to do, but not which function or command will do it.

The chapter which follows this one lists the keywords alphabetically, with explanations and full specifications.


Program control

Section Contents


Loops, branches, jumps

Repeat a set of instructions

DO...UNTIL, WHILE...ENDW

Do either one set of instructions or another set, or another, or another...

IF...ENDIF

Go...

 

...to a specified label

GOTO

...to one of a list of labels

VECTOR85ENDV

...to the end/start of a repeating set of instructions

BREAK, CONTINUE

...back to the calling procedure

RETURN

End the program

STOP


Error handling

Raise an error

RAISE

Put an explanatory comment in your program

REM

Declare an error-handler

ONERR...ONERR OFF

Let the program continue after an error

TRAP

After an error, find out what the error was

ERR, ERR$

After an error, find out what the extended error message was

ERRX$


Screen and keyboard control

Display a string to be edited and get a value from the keyboard

EDIT

Get a value from the keyboard

INPUT

Display text, numbers etc.

PRINT

Set screen update method

gUPDATE

Pause...

 

...for a number of seconds

PAUSE

...until a key is pressed

GET, GET$

Position or hide the cursor

AT, CURSOR

Clear the text window

CLS

Sound the buzzer

BEEP

Set the size/position of the text window

SCREEN

Get information on the text window

SCREENINFO

Set text window font and style

FONT, STYLE

Find out which key was pressed, if any

KEY, KEY$, GET, GET$

Find out what combination of modifiers was pressed

KMOD

Disable/enable stopping from a running program

ESCAPE OFF/ON

Turn the Psion off

OFF


Files

Section Contents


General file management

Copy a file

COPY

Delete or rename a file

DELETE, RENAME

Check to see if a certain file exists

EXIST

Find out what files there are

DIR$


OPL procedures and modules

Set up a procedure cache

CACHE

Load an OPL module file so you can use the procedures in it

LOADM

Remove a module from memory

UNLOADM

Include a file containing constant definitions and procedure prototypes

INCLUDE

Cause a error to be raised by the translator if a procedure or variable is used before it is declared

DECLARE EXTERNAL

Declare a procedure or variable as external

EXTERNAL


Data files and databases

Create a new data file, databse or table

CREATE

OPEN or CLOSE a data file, database or table

OPEN, OPENR, CLOSE

Delete a table from a database

DELETE

Use a different data file that has been opened

USE

Copy a data file, optionally appending to another data file, and removing deleted records

COMPRESS

Once a data file has been OPENed, you can:

 

Make a new record

APPEND

Change a record

UPDATE

Search for those records which contain a certain string

FIND, FINDFIELD

Erase a record

ERASE

Move to a different record

FIRST, LAST, NEXT, BACK, POSITION

Count the records

COUNT

Find whether you’re at the end of the file yet

EOF

Find the current record number

POS

Find the number of bytes used by the current record

RECSIZE

Begin a transaction

BEGINTRANS

Commit a transaction

COMMITTRANS

Find out whether the current view is in transaction

INTRANS

Cancel the transaction

ROLLBACK

Insert a bookmark

BOOKMARK

Goto a bookmark

GOTOMARK

Delete a bookmark

KILLMARK

Insert a new blank record

INSERT

Modify a record

MODIFY

Make changes to a database permanent

PUT

Cancel changes made to a database

CANCEL

Compact a database (see COMPRESS)

COMPACT


Managing directories

Create directory

MKDIR

Set current directory

SETPATH

Remove directory

RMDIR


Memory

Declare variables

GLOBAL, LOCAL

Declare a constant

CONST

Find how much free memory there is on a device

SPACE


Printing

Specify a device or file to print to

LOPEN

Close the print device or file opened with LOPEN

LCLOSE

Print to a device or file

LPRINT


Numbers

Section Contents


Trigonometry

Trig functions

COS, SIN, TAN, ACOS, ASIN, ATAN

Convert between degrees and radians

RAD, DEG


Other functions

Raise e to a power

EXP

Logarithms

LN, LOG

Pi as a constant

PI

Square root

SQR

Use random numbers

RND, RANDOMIZE

Unsigned integer/pointer arithmetic (in the 64K limit)

UADD, USUB


Lists of numbers

Find the greatest or smallest value in the list

MAX, MIN

Average the list

MEAN

Add up the list

SUM

Find the standard deviation or variance

STD, VAR


Changing the format of numbers

Knock the minus sign off a number

ABS, IABS

Take whole number, removing any fractional part

INT, INTF

Convert...

 

...an integer into floating-point

FLT

...an integer into a hexadecimal string

HEX$

...a number into a string

FIX$, GEN$ SCI$, NUM$

...a string into a number

EVAL, VAL


Strings

Copy characters from a string

LEFT$, MID$, RIGHT$

Repeat a string

REPT$

Make a string upper or lower case

UPPER$, LOWER$

Find out...

 

...how long a string is

LEN

...the character code of the first character of a string

ASC

...where a certain string is within a string

LOC

Convert...

 

... a string of digits to a number

VAL

...a number to a string

FIX$, GEN$ SCI$, NUM$

Get the character with a certain character code

CHR$


Date and time

Find out the current date and time...

 

...as a string

DATIM$

...just the current time

SECOND, MINUTE, HOUR

...just the current date

DAY, MONTH, YEAR

Find out...

 

...the number of days between two dates

DAYS

...what day of the week, or what week number, a certain date falls in

DOW, WEEK

Express...

 

...1-12 as the name of a month

MONTH$

...1-7 as a day of the week

DAYNAME$

Convert between seconds and dates

DATETOSECS, SECSTODATE

Convert between days and dates

DAYSTODATE


Graphics

Section Contents


Drawing commands

Set current position

gAT, gMOVE

Set current pen width

gSETPENWIDTH

Draw a line

gLINEBY, gLINETO

Draw a sequence of lines

gPOLY

Draw a circle

gCIRCLE

Draw an ellipse

gELLIPSE

Draw a rectangle

gBOX

Draw a border

gBORDER, gXBORDER

Fill a rectangle

gFILL

Invert a rectangle

gINVERT

Scroll a rectangle

gSCROLL

Get current position

gX, gY

Display a running clock

gCLOCK

Draw a 3-D button (key)

gBUTTON

Draw a lozenge

gDRAWOBJECT


Displaying graphics text

Display a list of expressions

gPRINT

Display text in a cleared box

gPRINTB

Display text neatly clipped

gPRINTCLIP

Find width required by text

gTWIDTH

Display text underlined/highlighted

gXPRINT


Setting styles

Set graphics to set / clear / invert pixels

gGMODE

Set text to set / clear / invert / replace pixels

gTMODE

Set font to use

gFONT

Load and unload user-defined fonts

gLOADFONT, gUNLOADFONT

Set text to bold / underline / inverse / double / mono / italic

gSTYLE


Windows and bitmaps

Create a new window

gCREATE

Set position and/or size of a window

gSETWIN

Set order to show windows

gORDER

Get order of a window

gRANK

Set window visible / invisible

gVISIBLE

Get screen position of a window

gORIGINX, gORIGINY

Create a bitmap

gCREATEBIT

Load a bitmap from file

gLOADBIT

Clear a window / bitmap

gCLS

Save window / bitmap to bitmap file

gSAVEBIT

Close down a window / bitmap

gCLOSE

Set which window / bitmap to use

gUSE

Set foreground colour of current window

gCOLOR

Swap between grey and black pens

gGREY

Set grey on/off in a window

gGREY

Set colour mode of default window

DEFAULTWIN

Enable grey in default window

DEFAULTWIN

Fill an area with repetitions of another window / bitmap

gPATT

Copy an area from one window / bitmap to another

gCOPY

Read data back from a window / bitmap

gPEEKLINE

Get ID number of a window / bitmap

gIDENTITY

Get size of a window / bitmap

gWIDTH, gHEIGHT

Get status information about a drawable and about the cursor

gINFO

Get status information about a drawable and about the cursor

gINFO32


Sprites

Create a sprite

CREATESPRITE

Define bitmap-sets for a sprite

APPENDSPRITE, CHANGESPRITE

Draw a sprite

DRAWSPRITE

Set a sprite’s position

POSSPRITE

Close a sprite

CLOSESPRITE


Menus

Start a new set of menus

mINIT

Define a menu

mCARD

Define a cascade for a menu

mCASC

Display menus

MENU

Define a popup menu

mPOPUP


Dialogs

Start a new dialog

dINIT

Position a dialog

dPOSITION

Define text for a dialog

dTEXT

Define an edit box for a dialog

dEDIT

Defines a multi-line edit box for a dialog

dEDITMULTI

Define a secret edit box for a dialog

dXINPUT

Define a filename edit box for a dialog

dFILE

Define a choice list for a dialog

dCHOICE

Defines an item with a checkbox for a dialog

dCHECKBOX

Define a numeric edit box for a dialog

dFLOAT, dLONG

Define a date or time edit box for a dialog

dDATE, dTIME

Define exit keys for a dialog

dBUTTONS

Display a dialog

DIALOG

Display a simple ‘alert’ dialog

ALERT


Series 3c and Siena status window

Display/hide status window

STATUSWIN

Get status window information

STATWININFO

Set a program’s name

SETNAME

Initialise a list

DIAMINIT

Position on a list

DIAMPOS


Screen messages

Display information messages

GIPRINT

Display ‘busy’ messages

BUSY


OPL applications

Define an OPA

APP...ENDA

Declares an OPAs icon

ICON

Give an OPAs caption in the given language

CAPTION

Specify whether an OPA is document-based

FLAGS

Set the type of an OPA

TYPE

Give the file extension used by an OPA

EXT

Give the directory to use for an OPA’s files

PATH

Mark an OPA as locked or unlocked

LOCK


Advanced use

Run machine code

USR, USR$

Find out where a certain variable is in memory

ADDR

Store a value in a specific place in memory

POKE commands

Find out the value stored at a certain place in memory

PEEK commands

Open any type of file

IOOPEN

Read from a file opened with IOOPEN

IOREAD

Write to a file opened with IOOPEN

IOWRITE

Close a file opened with IOOPEN

IOCLOSE

Position within a file opened with IOOPEN

IOSEEK

Keywords which provide low-level access to the Psion

Call an operating system service

CALL, OS

Perform an asynchronous I/O function

IOA, IOC

Cancel an asynchronous I/O function

IOCANCEL

Wait for completion of a function performed by IOA or IOC

IOWAIT, IOWAITSTAT,

Wait for completion an asynchronous OPX procedure

IOWAITSTAT32

Signal completion of an I/O function

IOSIGNAL

Ensure an asynchronous handler runs

IOYIELD

Perform a synchronous I/O function

IOW

Perform an asynchronous keyboard read

KEYA

Cancel a KEYA

KEYC

Get command line information

CMD$, GETCMD$

Set a file to be a document

SETDOC

Get the name of the current document

GETDOC$

Parse a full file specification

PARSE$

Check for system events

GETEVENT, TESTEVENT

Check for system and pointer events

GETEVENT32, GETEVENT32A

Cancels GETEVENTA32

GETEVENTC

Filter pointer events out or reinstate them

POINTERFILTER

Get system-level info on data files

ODBINFO

Load/link a DYL

LOADLIB, LINKLIB

Unload a DYL

UNLOADLIB

Find category handles

FINDLIB, GETLIBH

Create new objects

NEWOBJ, NEWOBJH

Send a message to an object

SEND, ENTERSEND, ENTERSEND0

Allocate a heap cell

ALLOC

Free an allocated cell

FREEALLOC

Change size of allocated cell

REALLOC

Insert or delete section of cell

ADJUSTALLOC

Find length of allocated cell

LENALLOC

Remove returned procedures from a cache

CACHETIDY

Read cache index header

CACHEHDR

Read cache index record

CACHEREC

Set flags (mainly for Series 3c compatibility)

SETFLAGS

Clears flags set by SETFLAGS

CLEARFLAGS


EPOC logo Left Right Up