OPLDatabaseFile PEEKB(x%),PEEKW(x%),PEEKL(x%) PEEKF(x%),PEEK$(x%)#POKEB x%,y% - Rem - format for poke. gCLOCK ON,mode%,offset% gCLOCK ON gCLOCK OFF a$=CHR$(x%) a$=Character string(ascii) r%=ALERT(m1$,m2$,b1$,b2$,b3$) 'Displays Alert window with your message APPEND Adds a record to a database file a%=ASC(a$) a%= ascii char for a$ gAT x%,y% 'sets cursor position in graphics window AT x%,y% #sets cursor position in text window %go back one position in database file BREAK Break out of a Do...until loop CLOSE Close a database file Clear the screen CONTINUE Jumps back to While command in WHILE...ENDWH loop< COPY src$,dest$ Copy a file deleted record space not freed6 (Clears the screen of the active graphic window0 a=ACOS(x) #a=Arc cosine or inverse cosine of x a=ASIN(x) a=arc sine or inverse sine of x a=ATAN(x) 'a=arc tangent or inverse tangent of x a=ABS(x) $a=Absolute value of floating point x c$=CMD$(x%) x%=1 - 5"Returns command line argument when starting a program (See manual)+ c=COS(x) c=cosine of x x=angle in radians3 c%=COUNT 'c%=number of records in a database file CURSOR ON (text cursor on) CURSOR Off(text cursor off)(CURSOR id%,asc%,width%,height% (graphic)(asc%=ascent height%=font height Width%=2^ &s&=DATETOSECS(yr%,mo%,dy%,hr%,mn%,sc%) &s&=seconds since 00:00 1/1/1970 at the date specified> d$=DATIM$ d$=current date and time Fri 16 Oct 1992 16:25:30* d%=DAY d%=current day of month (1 - 31) d$=DAYNAME$(x%) %d$=Day of the week as 3 letter string d$=Fri (TGIF)e d&=DAYS(day%,month%,year%) #d&= number of days since 01/01/1900$get number of days between two datese dBUTTONS p1$,k1%,p2$,k2%,p3$,k3% p1$=text k1%=keycode "defines exit keys to go at bottom dialogM dDATE var lg&,p$,min&,max& defines an edit box for a date to go in a dialog dEDIT var str$,p$,len%%defines a string edit box to go in a dialog. str$ is variable to edit'p$ displays on left, len% is max length, d=DEG(x) converts from radians to degrees DELETE filename$ filename$ must be closed wildcards OK dFILE var str$,p$,f%#defines filename edit box with Disk$selector. str$ must 128 char length%p$ displays on left. f% decides type. dFLOAT var fp,p$,min,max#defines edit box for floating point number. p$ dislays on left'min&,max& are minimum and maximum inputD d%=DIALOG !presents dialog prepared by DINIT if Enter pressed p%<>0< dINIT title$ dINIT%prepares for definition of new dialogl d$=DIR$(filespec$) then d$=DIR$("") Produces a listing of filenames&includes subdirectories. Wildcards OK.v dLONG var lg&,p$,min&,max&!defines edit box for long integer p$ displays on left$min&,max&=min-max input. returns lg&E statements(actions) UNTIL condition Loops until condition is trueO dPOSITION x%,y% x%,y% can be -1,0,1 -1=top / 0=center / 1=bottom dPosition 0,1b dTEXT p$,body$,t% p$ displays on left% t%=alignment 0=left 1=right 2=center body$=text to display dTIME var lg&,p$,t%,min&,max&(defines an edit box for a time to go in'a dialog . p$=left t%=time display type 0-1=absolute 2-3=durationJ dXINPUT var str$,p$ Secret input&displays lock character for each input0 ERASE 'Erase current record of a database file e%=ERR e$=ERR$ e%=error number e$=error stringC ESCAPE OFF . . . ESCAPE ON'stops Psion from exiting a programT d=EVAL(s$) Evaluates a mathematical string's$ can include any function or operatorJ e%=EXIST(filename$) e%=-1 if the file exists e%=0 if file does not existL e=EXP(x) (e=val of arithmetic constant(2.71828...) raised to the power of x5 EXT name$ "Gives file extension to be used by an OPAa f%=FIND(a$) f%=0 if not found&searches a database file for string a$ f%=position found if exists EDIT a$ / EDIT a.a$ Edit a variable in a text window Edit a field in a database file r%=IOOPEN(h%,name$,mode%) r%=IOCLOSE(h%) r%=IOREAD(h%,addr%,maxlen%) r%=IOWRITE(h%,addr%,length%) r%=IOSEEK(h%,mode%,off&) r%=IOW(h%,func%,a1,a2) r%=IOA(h%,f%,status%,a1,a2) IOWAIT IOSIGNAL IOYIELD IOWAITSTAT stat% CONNECT 20 GOTO again Waits by 1/2 secs for Handshake HANGUP drops DTR for 3 sec's Modem will hangup' RESET set parameters back to original SETUP (BAUD=? :PARITY=? :DATA=?#STOP=? :HANDSHAKE=? :FAIL=? :ECHO=?!NEWLINE=? :BACKSPACE=? :TIMEOUT=?: !ON REPLY CONNECT 2400 goto label in brackets after wait SEND PW$ SEND "ATZ" ,SENDWAIT 10"COMPUSERVE","USER ID:" goto next WAIT 40 waits 20 seconds CAPTURE filename$ Captures all data to a file EXISTS fn$ goto next checks for existing file jumps if existsG NEXISTS fn$ goto next checks for existing file jumps if does not existQ RECEIVE fn$, XMDM XMDM,XMCRC,XM1K,YMDM,YMDMG#YM1K,YG1K Rem -- receive w/Protocol TRANSMIT fn$, XMDM see RECEIVE ALERT message$ Displays alert BEEP x%,y% INFO mess$ displays message on bottom right8 MENU title$ (c1$ goto redo c2$ goto send c3$ goto quit)+ PASSWORD ask for Pw of current names file QUERY CALL script2$ "stops current script, starts other stop ruuning script GOTO label jumps to a label set a counter :c1=10" DRAIN empties the receive buffer? e%=EOF End of file Databse file must be open -1=true 0=false A FIRST $Positions to the first record in the current data file. f$=fix$(x,y%,z%) $Returns a string representation of x to y% decimal places(Useful for converting a number to stringI f=FLT(x&) #Converts an integer expression into a floating point number. gBORDER flags%,width%,height%) width%,height% optional $Draws a one pixel border around the current drawable.b gBOX width%,height%) %Draws a box from the current position$width% to the left and height% down. gCLOSE win% $Closes graphic window with id (win%) Every graphic window has an id. gCOPY id%,x%,y%,w%,h%,mode%%Copies rectangle of spec'd size w%,h%%from the point x%,y% in drawable id%,'to the current position in the current (drawable. mode% 0,1,2,3 set,clr,inv,replz id%=gCREATEBIT(width%,height%) %Creates a bitmap with the spec'd size!and makes it the current drawable Returns id% (2-8) gCREATE(x%,y%,w%,h%,v%) v%= ON or OFF!creates a window with spec'd size w%=width h%=height%at position x%,y% /Returns id% (2-8)c g$=GEN$(x,y%) Returns a string rep of x up to y% char's in length if y%<0 will be right justifiedR g%=GET g$=GET$ $Waits for a keypress and returns the character code for that key. w$=GETCMD$!Return NEW command-line arguments'to an OPA, after a change files or quit event has occurred. First char of w$ is C,O,XZ GETEVENT var a%() Waits for an event to occur. 'Returns with a%() specifying the event. gFILL width%,height%,gMode% #Fill a rectangle of the spec'd size"from the current pos, according to gMode%W gGMODE mode% 0=set 1=cleared 2=inv(Set the effect of all subsequent drawing commands.= height%=gHEIGHT Returns the height of th current drawable. id%=gIDENTITY &Returns the id of the current drawable gINFO var i%()#Gets general info about the current drawable and graphics cusor. $See manual for list of info returned gINVERT width%,height% #Inverts the rectangle width% to the'right and height% down from the cursor %pos,except for the four corner pixels GIPRINT str$,c%$Displays info message for two sec's. c% sets corner for message. 0 = top left / 1 = bottom left 2 = top right / 3 = bottom rightI gLINEBY dx%,dy% Draws a line from current pos dx% to the right dy% downd gLINETO x%,y% !Draws a line from the current pos to point x%,y%#single point=gLINETO to current posg gFONT fontid% %Sets the font for current drawable to fontid%. 'Use gLoadfont to load user defined font gLOADBIT(name$,write%,i%)&write% 0=readonly 1=readwrite .Loads a& bitmap from the named bitmap file and( makes it the current drawable. ext=.pic"i%=which bitmap to use if multiplep fontid%=gLOADFONT(name$) #Loads the user defined font (name$)$Returns a font id. Use gfont to make active font.r GLOBAL variables (Declares variables to be used in current(procedure, or any subsequent procedures called by it. gMOVE dx%,dy%&Moves the current pos dx% to the right"and dy% downwards, in the current "drawable. Negative dx% moves left. Negative dy% moves upward.F gORDER id%,position% Reorders position of windows positions are 1-8 x%=gORIGINX 'Returns gap between left side of screen#and left side of the current window Cant be a bitmap.Z y%=gORIGINY "Returns gap between the top of the(screen and the top of the current window GOTO label GOTO label::#Jumps to label in current procedure gPATT id%,width%,height%,mode%!if id%=-1 predefined grey is used%Fills a rectangle of spec'd size from(the current position with repititions of the drawable id%L d%=DOW(day%,month%,year% d%=day of week (1 - 7) year is between 1900-2155 rank%=gRANK %Returns foreground/backround position"from 1 - 8, of the current window. gPOLY a%()$Draws a sequence of lines described by array a%(). a%(1)-a%(7) gPRINT list of expressions (Displays string, or variable or list of %expressions. gPRINT "This is a test" w%=gPRINTCLIP(text$,width$)&Displays text$ at the current position"displaying only as many characters!as will fit inside width% pixels.'Returns number of characters displayed.L COMPRESS src$,dest$ "Copies file, freeing up space used by deleted records gSETWIN x%,y%,wd%,ht% wd%,ht% optional Sets size/ pos of active window use gUSE to change active window gSTYLE style% Sets style of font gPEEKLINE id%,x%,y%,d%(),ln%'Reads a horiz line from id%,length ln%,%starting at x%,y%. leftmost 16 pixels#are read into d%(1), 1st pixel into least significant byten gPRINTB t$,w%,al%,tp%,bt%,m%#text,width,align,top,bott clearance margin offset al% 1=right 2=left 3=centered gSAVEBIT name$,width$,height$ gSAVEBIT name$&Saves current drawable as named bitmap%file(name$) .pic is default extensionh gSCROLL dx%,dy%,x%,y%,wd%,ht% gSCROLL dx%,dy%%Scrolls pixels in current drawable by offset dx%,dy% .X gTMODE mode%"Sets the way char's are displayed.%0=set 1=cleared 2=inverted 3=replaced width%=gTWIDTH(text$) Returns width of text$ gUNLOADFONT fontid% (Unloads a user defined font loaded using gLOADFONT.#built in fonts can not be unloaded.Y gUPDATE ON gUPDATE OFF gUPDATE!gUPDATE OFF stops the screen from updating as frequently.R gUSE id% Makes the drawable id% current'Use gorder to bring to front if needed. gVISIBLE ON/OFF #Makes the current window visible or invisible. width%=gWIDTH &Returns the width of current drawable. x%=gX Returns the x% current position!(in from the left) in the current drawable. gXPRINT string$,flag%$Displays string$ at the current pos, flag% 0=normal 1=inverse 2=inv(except corner 3=thin inv'4=th inv(exc corn) 5=underl 6=th underlD y%=gY &Returns y% current pos (down from top) in current drawable. h$=HEX$(x&) %Returns string containing hexadecimal representation of x& (or x%) h%=HOUR Returns hour number from clock i&=IABS Returns absolute value of i& ICON name$ !Gives the name of the bitmap file to be used in an OPA Used between APP...ENDA commands( IF condition1 ELSEIF cond 2 ENDIF INPUT var INPUT log.field Get data input from the keyboard(and assign it to a variable or data file9 i&=INT(x) $Returns the integer part of floating point x i=INTF(x) $Converts x to an integer and returns as floating point k%=KEY 'Returns character code of last keypress k$=KEY$ "Returns last key pressed as string err%=KEYA(var stat%,var key%(1)) #asynchronous keyboard read function err%=KEYC(var stat%) !Cancel the previously called KEYA function with status stat% k%=KMOD k% and (2= shift)(4= Control) (8= PSION)(16= Caps lock)#Returns code representing state of modifier keys, #Moves to last record in a data file LCLOSE #Closes the device opened with LOPEN b$=LEFT$(a$,x%) "Returns the leftmost x% characters of string a$ a%=LEN(a$) a%=length of string a$ a=LN(x) 'Returns the natural( base e) logarithym of x.!Use LOG to return the base 10 logv LOADM module$ %Loads a translated OPL module so that procedures in that module can be called. Example: LOADM "Module"3 a%=LOC(a$,b$) !a%=position in a$ where b$ occurs LOCAL variables (Declare variables to be used in current procedure only. LOCK ON LOCK OFF #Makes program escapable from system'screen. or LOCK ON will make app busy.& a=LOG(x) a=base 10 logarithym of x LOPEN device$ if Device$=TTY:A serial port if Device$=PAR:A Parallel port LOPEN "Rem::c:\bak\memo.txt"!will open file on remote computer% b$=LOWER$(A$) b$=lower case of A$ LPRINT list $Sends list to device opened by LOPEN(can a local file, remote file,or printer m=MAX(list) m=MAX(array(),element)%m=greatest of a list of numeric items mCARD title$,n1$,k1%,n2$,k2%(Defines a menu list. title$ is the name"to display at the top of the menu.#1-6 items can be defined under each&title. n1$=item1 k1%=keycode for item1Z m=MEAN(list) m=MEAN(array(),element) 'm=mean average of numeric items in the array list.\ val%=MENU &Display the menus defined by minit and mcard."If Esc pressed, returns 0, not 27.K m$=MID$(a$,x%,y%) m$=middle y% characters of a$ starting at character x% m=MIN(list) m=MIN(array(),element) (m=smallest of the list of numeric items. mINIT !Prepares for definition of menus. Use mcard to define each card Use Menu to display them.1 m%=MINUTE #m%=current minute from system clock MKDIR name$ Creates a new directory Example: MKDIR "M:\OPLHELP" or MKDIR "B:\PSION\SYS\BAK"/ m%=MONTH "m%=current month fro, system clock m$=MONTH$(x%) $Converts x% (1-12) to the month name expressed as three letter month abreviation.0 'Positions to next record in a data file n$=NUM$(x,y%)(Returns a string rep of the integer part'of the floating-point number x, rounded to the nearest whole number. String is up to y% characters~ or&OFF x% (x%=8-16383) (up to 4.5 hours)&Turns Series 3 off until On is pressed(or OFF x% or a set amount of time in sec ONERR label ONERR OFF$Set up your error handling in a proc!Any error will jump to your label(You can give option to continue or stop. OPEN file$,log,f1,f2...'Refer to fields as log.f1 or (a.field$)%Opens a data file. log is(A,B,C,orD)(Using different log you can have up to 4 data files open at once. S OPENR "Same as OPEN but file is read only'Append or Update command will not work a%=OS(i%,addr1%) a%=OS(i%,addr1%(),addr2%())%Calls the Op sys interupt i%, reading%values of all returned registered and#flags. (Returns AX,BX,CX,DX,SI,DI) p$=PARSE$(f$,rel$,var off%())(p$=full file name w/Device name and full"path name. off%(1-6) contains the (location in the string of each component of the file specification._ PATH name$ %Gives a directory to use for an OPA's files. Use this command between APP and ENDAT PAUSE x% PAUSE -x% 20 = 1 second!neg number pause for x% or until a key is pressed* !Returns the value of PI (3.14...) p%=POS %p%=current position in open data file POSITION x% "Makes record number x% the current record in the current data file PRINT list of expresions &Displays a list of expressions on the $screen. Wont print text in a graphic&window. Use one of the GPRINT commands/ r=RAD(x) "Converts x from degrees to radians RAISE x% Forces error number x% RANDOMIZE x& "Gives a seed (start-value) for RND r%=RECSIZE r%=size of current in bytes. A data file must be open.$1022 bytes is the limit for a record5 REM text (Preceeds a REMark or note in a procedure RENAME file1$,file2$ Renames file1$ as file2$ no wildcards r$=REPT$(a$,x%) (Returns a string comprising x% repitions of a$. RETURN or RETURN var (Quit and return var)(Stops the current procedure and returns to the point it was called from.5 r$=RIGHT$(a$,x%) r$=rightmost x% characters of a$ RMDIR str$ Removes directory called str$ r=RND %r=random floating-point number in the#range 0(inclusive) to 1 (exclusive)(For bigger #'s use f%=1+int(RND*6) etc..m s$=SCI$(x,y%,z%)'s$=string rep of x in scientific format!to y% decimal places and up to z% characters wide. SCREEN width%,height%,x%,y% x%,y% optional'Changes the size of the window in which text is displayed. s%=SECOND #s%=current second from system clock SECSTODATE s&,yr%,mo% dy%,hr%,mn%,sc%,yrday% #s&= number of seconds from 1/1/1970$to date spec'd in yr%,mo%,dy% etc..._ SETNAME name$ %Sets the name of running OPA to name$(and updates any status window with name$ SETPATH name$ name$="M:\PATH\"#Sets the current directory for file&access. LOADM continues to use dir of initial prog. 6 s=SIN(angle) %s=sine of angle, expressed in radians s&=SPACE %s&= free bytes on the device on which$the curent (open) data file is held. IOW, a data file must be open s=SQR(x) s= square root of x STATUSWIN ON/OFF 'Makes a permanent status window visible&or invsisble. Permanent status win is behind all other win's.U s=STD(list) s=STD(array(),element)!s=standard deviation of a list of numeric items. Stops the running program. Not the same as RETURN. s=SUM(list) %s=the sum of a list of numeric items. t=TAN(angle) (t=tangent of angle, expressed in radians t%=TESTEVENT !t%=true if an event has occurred. Use GETEVENT to read the event. TRAP command'error handling command that can preceed&a list of OPL commands too numerous to list here . TYPE num% Sets the type f an OPA from 0-4. Use between APP and ENDA UNLOADM module$ Removes from memory the module (module$) loaded with LOADM UNTIL Do"condition(whatever you want to do) UNTIL condition is true UPDATE 'Resaves the current record with changes It saves to the end of the file. u$=UPPER$(a$) u$=upper case of a$ USE logical name&Selects the data file with the logical!name A,B,C,or D.(See OPEN,CREATE) u%=USR(pc%,ax%,bx%,cx%,dx%) Executes your machine code."variables passed to 8086 registers u%=value of AX Register u$=USR$(pc%,ax%,bx%,cx%,dx%) Executes your machine code.&variables are passed to 8086 registers u$=AX register v=VAL(numeric string) %v=Value of a number that is in string format. Example: v=VAL(a.amount$)M v=VAR(list) v=VAR(array(),element)!Returns the variance of a list of items. VECTOR I% label1,label2 ENDV$Jumps to label number i% in the list of labels.A w%=WEEK(day%,month%,year%) "w%=week number in which day% falls WHILE expression ENDWH(Repeats the commands between WHILE..ENDW as long as expression is true, y%=YEAR y%=year number from system clock e%=CALL(s%,bx%,cx%,dx%,si%,di%) Make operating system calls.!INT num is least sig byte of s%. $AH value is the most sig byte of s%.'Other args pass to respective registersV APP name type (0-4) PATH... EXT... ICON... ENDA%These commands are for creating OPA's` BEEP time%,pitch% Rem -- time%/32 secs Rem -- 512/(pitch%+1) KHZ time% max is 3840 (2 minutes) CREATE fil$,log,f1,f2... Creates a database file"OPL default data extension is .odb when creating. Overide by using Create "M:\PATH\new.dbf"C a%=ADDR(var) "Returns address reserved in memory for variable var BUSY str$,c%,delay% str$<20 chr's c%=screen position 0-3"Puts blinking message in corner c% dCHOICE var choice%,p$,list$(choice% = choice number chosen from list p$ displays on left(list$ contains list of choices("Yes,No")