Usage: p$=PARSE$(f$,rel$,var off%())
Returns a full file specification from the filename f$, filling in any missing information from rel$.
The offsets to the filename components in the returned string is returned in off%() which must be declared with at least 6 integers. Index values for off%() are:
1 |
Filing system name offset. |
|
2 |
Device name offset. |
|
3 |
Path offset. |
|
4 |
Filename offset. |
|
5 |
File extension offset. |
|
6 |
Flags for wildcards in returned string. See below. |
The flag values in offset%(KParseAOffWild%) are:
0 |
No wildcards. |
|
1 |
Wildcard in filename. |
|
2 |
Wildcard in file extension. |
|
3 |
Wildcard in both. |
These constants are supplied in Const.oph.
If rel$ is not itself a complete file specification, the current filing system, device and/or path are used as necessary to fill in the missing parts.
f$ and rel$ should be separate strings.
p$=PARSE$("NEW","C:\Documents\*.MBM",x%())
sets p$ to C:\Documents\NEW.MBM and x%() to (1,1,3,14,17,0).
Usage: PAUSE x%
Pauses the program for a certain time, depending on the value of x%:
0 |
waits for a key to be pressed |
+ve |
pauses for x% twentieths of a second |
-ve |
pauses for x% twentieths of a second or until a key is pressed |
So PAUSE 100 would make the program pause for 100/20 = 5 seconds, and PAUSE -100 would make the program pause for 5 seconds or until a key is pressed.
If x% is less than or equal to 0, a GET, GET$, KEY or KEY$ will return the key press which terminated the pause. If you are not interested in this keypress, but in the one which follows it, clear the buffer after the PAUSE with a single KEY function: PAUSE -10 :KEY
You should be especially careful about this if x% is negative, since then you cannot tell whether the pause was terminated by a keypress or by the time running out.
PAUSE should not be used in conjunction with GETEVENT or GETEVENT32 because events are discarded by PAUSE.
p%=PEEKB(x&)
The PEEK functions find the values stored in specific bytes. PEEKB returns the integer value of the byte at address x&.
p%=PEEKW(x&)
Returns the integer at address x&.
p&=PEEKL(x&)
Returns the long integer value at address x&.
p=PEEKF(x&)
Returns the floating-point value at address x&.
p$=PEEK$(x&)
Returns the string at address x&.
Usage: p=PI
Returns the value of
Usage: POINTERFILTER filter%,mask%
Filters pointer events in the current window out or back in. Add the following flags together to achieve the desired filter% and mask%:
|
$0 |
None. |
$1 |
Enter/exit. |
|
$2 |
Move. |
|
$4 |
Drag. |
These constants are supplied in Const.oph.
The bits set in filter% specify the settings to be used, 1 to filter out the event and 0 to remove the filter. Only those bits set in mask% will be used for filtering. This allows the current setting of a particular bit to be left unchanged if that bit is zero in the mask. (i.e. mask% dictates what to change and filter% specifies the setting to which it should be changed). For example,
mask% = KPointerFilterEnterExit% + KPointerFilterDrag% REM allows enter/exit and drag settings to be changed POINTERFILTER KPointerFilterEnterExit%, mask% REM filters out enter/exit, but not dragging ... POINTERFILTER KPointerFilterDrag%, mask% REM filters out drag and reinstates enter/exit
Initially the events are not filtered out.
See also GETEVENT32, GETEVENTA32.
POKEB x&,y%
The POKE commands store values in specific bytes. POKEB stores the integer value y% (less than 256) in the single byte at address x&.
POKEW x&,y%
Stores the integer y% across two consecutive bytes, with the least significant byte in the lower address, that is x&.
POKEL x&,y&
Stores the long-integer y& in bytes starting at address x&.
POKEF x&,y
Stores the floating-point value y in bytes starting at address x&.
POKE$ x&,y$
Stores the string y$ in bytes starting at address x&.
Use ADDR to find out the address of your declared variables.
Usage: p%=POS
Returns the number of the current record in the current view. POS (and POSITION) exist mainly for compatibility with older versions of OPL and you are advised to use bookmarks instead.
A file has no limit on the number of records. However, integers can only be in the range -32768 to +32767. Record numbers above 32767 are therefore returned like this:
record value |
returned by POS |
32767 |
32767 |
32768 |
32768 |
32769 |
32767 |
32770 |
32766 |
... |
... |
65534 |
2 |
To display record numbers, you can use this check:
IF POS<0 PRINT 65536+POS ELSE PRINT POS ENDIF
N.B. the number of the current record may be greater than or equal to 65535 and hence values may need to be truncated to fit into p%, giving inaccurate results. You are particularly advised to use bookmarks when dealing with a large number of records. Note, however, that the value returned by POS can become inaccurate if used in conjunction with bookmarks and multiple views on a table. Accuracy can be restored by using FIRST or LAST on the current view.
See BOOKMARK, GOTOMARK, KILLMARK.
Usage: POSITION x%
Makes record number x% the current record in the current view. By using bookmarks and editing the same table via different views, positional accuracy can be lost and POSITION x% could access the wrong record. Accuracy can be restored by using FIRST or LAST on the current view.
POSITION (and POS) exist mainly for compatibility with older versions of OPL and you are advised to use bookmarks instead.
See BOOKMARK, GOTOMARK, KILLMARK.
Usage: PRINT list of expressions
Displays a list of expressions on the screen. The list can be punctuated in one of these ways:
If items to be displayed are separated by commas, there is a space between them when displayed.
If they are separated by semicolons, there are no spaces.
Each PRINT statement starts a new line, unless the preceding PRINT ended with a semicolon or comma.
There can be as many items as you like in this list. A single PRINT on its own just moves to the next line.
Examples: On 1st January 1997,
code |
display |
PRINT "TODAY is", :PRINT DAY;".";MONTH;".";YEAR |
TODAY is 1.1.1997 |
PRINT 1 |
1 |
PRINT "Hello" |
Hello |
PRINT "Number",1 |
Number 1 |
See also LPRINT, gUPDATE, gPRINT, gPRINTB, gPRINTCLIP, gXPRINT.
Usage: PUT
Marks the end of a databases INSERT or MODIFY phase and makes the changes permanent.
See INSERT, MODIFY, CANCEL.