Where appropriate (and possible), I have listed the 'before' and 'after' for each change, which should make it easier for developers to update their code.
dclIns%:
procedure to insert strings into the list at
a particular position.ceil:
and floor:
for
rounding floating point numbers up and down (as opposed to the built-in
INTF
which rounds towards zero).busyOff:
so it ignores a handle equal to zero.
If you want to turn off the most recently added message, pass -1
instead of zero.wsDial%:
.GIPRINT
from gXINPUT$:
that
displayed what was typed! Whooops! How did that get there?dxDATE:
, dxINT:
,
dxLATLNG:
, dxLONG:
,
dxRANGE:
and dxTIME:
would ignore
changes made to them unless the arrow keys were used to select
a different control before accepting the dialog (pressing
Enter). Thanks to Hermann for alerting me to this.dxFLOAT:
so it takes two extra parameters:
width%
which specifies the maximum numbers of
characters allowed to be entered (the
OPL
dFLOAT
command always uses 20
) and
ndec%
that specifies the number of decimal places (the
OPL
dFLOAT
command always uses 0
(zero)
which allows a variable number of decimal places). The following
code fragments do the same thing:
PROC dodlg: REM standard OPL dialog LOCAL f dINIT dFLOAT f, "Number", 0, 999 DIALOG RETURN f ENDP PROC dodlg: REM dxXXX dialog LOCAL f dINIT dxFLOAT:( ADDR( f ), "Number", 0, 999, 20, 0 ) wsDial%: RETURN f ENDP
prPrintA:
procedure from the
WDR
Printer Driver Interface module. It's not needed anymore - use
prPrint:
.BUSY
command is no longer supported. See example code for
recommended usage.dxBUTTNS:
functionality.BUSY
messages
if your application needs to display several BUSY
messages asynchronously.dlgSmall:
.csptr%
to be zero.dclFind%:
to use built-in support for searching
the list.findFil$:
to search in A:,
B:, M: order.gFONTINF:
selecting the correct font.amGtRsc%:
and amLdRsc%:
procedures to
the Resource Messages module.rsLoad%:
procedure to replace the
amGtRsc%:
and amLdRsc%:
procedures. These last
two are now deprecated: replace amGtRsc%:
with
rsLoad%:("*",0)
and
amLdRsc%:(rscname$)
with rsLoad%:(rscname$,0)
.ioDspch%:
procedure.findApD$:
procedure that searches for application
data files based on the application name. Use it like:
fname$ = findApD$:( "FOO.BIN" )
. If your application
is called "MYPROG" it will search for
"\APP\MYPROG\FOO.BIN".fixKyMod%:
procedure that makes handling
Psion/Shift-Psion keypresses much easier.findIni$:
procedure that searches for
an INI file based on the application name. If there is no existing INI
file it returns a default name on the M: drive. Use it like:
inihdl% = iniOpen%:( findIni$:( "" ), 1 )
.findFil$:
to force it to search the
LOC::
filesystem instead of the default filesystem (which
is usually, but not always LOC::
).LOCK ON
and LOCK OFF
around the
Search-Replace code.rsAddMCX:
from accepting a single id%
parameter to taking two parameters: mnuid%
and
crdid%
. This means that the menu title and the items do
not have to be stored consecutively.
Old | New |
---|---|
rsAddMCX:( MNU_FOOBAR ) | rsAddMCX:( MNU_FOOBAR, CRD_FOOBAR ) |
rsMnuKy%:
procedure to return the keycode associated
with the given #menuitems
resource. It ignores any negate
sign (indicating an underlined menu item) and always returns a positive
keycode.eaKey%:
procedure into many smaller
procedures. This should allow for improved performance with a smaller
cache - freeing extra memory for the editor!ebGText%:
as it is not supported by the segmented
document object. See the ebSvFil%:
and
ebGPara$:
procedures to see how text retrieval is now
performed.ebGLen%:
as it is not supported by the segmented
document object. Use edGLen%:
instead.ebGClip%:
as it is not supported by the segmented
document object. There is no alternative procedure at this time.ebSvFil%:
completely re-written to support the segmented
document object. No changes required for callers.ebGPara$:
procedure to return the paragraph starting at
the given position. This can be used to step through the document object
(either flat or segmented).rsFmt$:
now supports some extra C-style format
placeholders: %1
, %2
, %3
,
%4
, %5
, %6
, %7
,
%8
, %9
. These are not required for system
resources, but would be useful for your own resources to implement
strings that allow a specific ordering of the variable parts.ioRem%:
to perform a RAISE -2
when an
attempt is made to remove an unknown handler instead of an
ALERT
with a hard-coded string followed by a
STOP
.bBTTNS%:
, bBTNADD:
, and
dBUTTONS:
procedures that allow dialog buttons to be built
button-by-button instead of all at once. It also allows more than three
buttons!LOCK ON
and LOCK OFF
around the dialog
and menu display code in wsDial%:
and
wsMenu%:
.amGtRsc%:
that returns the handle of
the currently loaded resource.findRsc$:
procedure that does an intelligent
search for your applications resource file, based on language
codes.ioNull%:
procedure that does nothing - it can be used
as an IOSIGNAL
"black hole".rsAddMC:
and rsAddMCX:
procedures
that can build menu bars from resource information.rsFmt%:
that replaces C-style formatters in a
string with another string.gFONTINF:
procedure that can obtain information on a
given font without gFONT
to be called beforehand.GETNAME$:
procedure that does the reverse of the
OPL command
SETNAME
.getMenu%:
procedure that returns the last highlighted
menu option, even if the menu was cancelled. Useful for
context-sensitive help.wsDialH%:
procedure that wraps a called to
wsDial%:
with code that saves, sets, and restores a
GLOBAL
variable called hlppage%
. Useful for
context-sensitive help.mCARD%:
, mITEM:
, and mADD:
procedures that allow menu bars to be built item-by-item instead of
card-by-card.ioDspch%:
. All I/O Event Manager
module I/O handlers (i.e. those registered via ioAdd%:
) can
now return values just like the EvtFunc$()
handlers - for
example, 2 will cause the most recent instance of amStart%:
to exit. No changes to your code are required, unless you are returning
non-zero value (and since the return values were ignored previously, you
most likely are returning nothing, which is the same as zero).cnOff%:
to mpStart%:
. Now you
don't have to call cnOff%:
yourself after
mpStart%:
returns.leadcap$%:
procedure to the
User Interface module.leadcap$:
procedure from the
Miscellaneous module.GLOBAL ioMngr%
is no longer required. The Application
Manager defines it itself inside mpStart%:
.wsOnTop%:
procedure now requires an extra integer
parameter. The argument is passed without modification to the user
procedure func$
, so that procedure requires a corresponding
extra integer parameter too.dItem%:
,
gEDIT$:
, gLONG&:
, gFLOAT:
,
gCHOICE%:
, sEDIT%:
, sLONG%:
,
sFLOAT%:
, sCHOICE%:
, sTEXT%:
,
sPROMPT%:
, gMIN:
, gMAX:
,
gMIN&:
, gMAX&:
, sMIN:
,
sMAX:
, sMIN&:
, sMAX&:
,
sDWMAX%:
, gDBUF$:
, dFOCUS%:
,
gFOCUS%:
, sFOCUS%:
,
sDONEWN%:
GLOBAL ioMngr%
is no longer required. The Application
Manager defines it itself inside mpStart%:
.ioRem:
to ioRem%:
, i.e. it now returns
an integer. The actual return value is undefined, but the signature now
allows ioRem%:
to be specified as an I/O handler to
automatically remove a handler when it completes.memset%:
, memcpy%:
,
memcmp%:
, ztslen%:
, zts2lbc$:
and
lbc2zts%:
procedures from the
Miscellaneous module.memset%:
, memcpy%:
,
memcmp%:
, ztslen%:
, zts2lbc$:
and
lbc2zts%:
procedures to the new
Memory Utilities module.dXitKey%:
, dlgItem%:
,
dlgFlags:
, gAPPBIT%:
and giprint:
procedures to the new User Interface module.fileinf&:
procedure to get file information
(size, time of last modification, attributes).abstime:
procedure that returns an absolute
sub-second time value.leadcap$:
procedure that capitalises a string. The
first character is forced to uppercase, the rest are forced to
lowercase.sndRecA%:
, sndRecC:
,
sndRecS%:
, sndPlyA%:
, sndPlyC:
and sndPlyS%:
procedures.dXitKey%:
, dlgItem%:
,
dlgFlags:
, gAPPBIT%:
and giprint:
procedures from the Miscellaneous module.dlgItem%:
and dlgFlags:
procedures now
count dialog lines starting at one instead of zero, in keeping with
standard OPL
practice.dlgSmall:
procedure that sets the dialog box
currently being constructed to use a small font. This only does anything
on Workabout machines. Calling it for other machines does nothing and is
harmless. It is effectively the same as the Workabout
dINITS
command, except that it can be compiled and executed
on any SIBO machine. It
must be called between the dINIT
and the
DIALOG
/wsDial%:
.drawsbs%:
procedure that draws
OVAL
style scrollbars.gROTATE%:
procedure that can rotate a portion of a
drawable through 90-degrees into a new bitmap.memset%:
, memcpy%:
, memcmp%:
,
ztslen%:
, giprint:
.rsdtctb$:
.ONERR
handler, the default one now works! It displays a small
dialog with text describing the error, then allows the program to continue
operating (sort of - it obviously can't re-post I/O requests - you must
provide your own error handling for that, but console event requests are
automatically reset).gAPPBIT%:
to the Miscellaneous
module. This allows bitmaps embedded inside your
OPA
(including its icon) to be loaded just like using
gLOADBIT
.prPrintA:
procedure to the
WDR
Printer Driver Interface to fix 'Panic 111' errors when used with the
Asynchronous Application Manager module. NOTE
FROM AUTHOR: I still get 'Panic 111' errors when I use a printer that has
anything to do with the serial port, such as 'Print via
PC' or 'Postscript (via
Serial)'. This could be because my test application is actively using the
serial port (although I have closed the port for the duration of the print
test). Printing to file works fine.Fixed several issues during the conversion of my Dark Light program. None of these require changes to user code.
EvtFunc$(20)
now works).mpStart%:
procedure will call the
done$
procedure and exit.wsDial%:
procedure of the
Synchronous Application Manager module. It used
to generate a 'Structure Fault' error.Modified the following procedures to accept a dialog box handle. Since things can occur in your application asynchronously, these procedures need to know which dialog box to refer to (in case you have more than one on the screen at once). This includes times when you might have a help window over a dialog box that is updating in the background.
dCLOSE:
, dCount%:
, dItem%:
,
gEDIT$:
, gLONG&:
, gFLOAT:
,
gCHOICE%:
, sEDIT%:
, sLONG%:
,
sFLOAT%:
, sCHOICE%:
, sTEXT%:
,
sPROMPT%:
, gMIN:
, gMAX:
,
gMIN&:
, gMAX&:
, sMIN:
,
sMAX:
, sMIN&:
, sMAX&:
,
sDWMAX%:
, gDBUF$:
, gFOCUS%:
,
sFOCUS%:
, sDONEWN%:
.
For each procedure, the extra parameter dlg%
has been
inserted at the front of each parameter list. This extra parameter must be
the dialog handle (usually PEEKW($36)
). To ease the
conversion of your existing code, a zero may be passed which will be
converted to PEEKW($36)
inside the procedures.
For example, the code: (taken from the old gauge tutorial)
... LOCAL olddlg% ... olddlg% = PEEKW( $36 ) :REM save current window POKEW $36, dlg% :REM set the dialog that has the progress bar REM (we saved the handle earlier in a GLOBAL) sDONEWN%:( 2, xfr& ) :REM 2=dialog line of progress bar, xfr& REM is (for this example) the number of bytes REM transferred so far (out of filesz&) POKEW $36, olddlg% ...
would become:
... sDONEWN%:( dlg%, 2, xfr& ) :REM dlg% saved in a GLOBAL (the same as above example) ...
or, alternatively (minimal code changes):
... LOCAL olddlg% ... olddlg% = PEEKW( $36 ) :REM save current window POKEW $36, dlg% :REM set the dialog that has the progress bar REM (we saved the handle earlier in a GLOBAL) sDONEWN%:( 0, 2, xfr& ) :REM 2=dialog line of progress bar, xfr& REM is (for this example) the number of bytes REM transferred so far (out of filesz&) POKEW $36, olddlg% ...
dlgItem%:
to take an extra parameter: a dialog
handle. This is the same change as in the Asynchronous Application Manager
above. See above for more information.filesiz&:
procedure that returns the size of a
file without needing to open it. It can be called on an open file without
moving your current position.lkTerm%:
added a short pause after closing the link to
give the system time to free the serial port. Without it, attempts to open
the serial port (eg. for general communications) immediately after will
fail. No changes are required to user code.dCurrnt%:
to gFOCUS%:
, added
sFOCUS%:
and dFOCUS%:
. sFOCUS%:
may only be called when the dialog box is visible on the screen
(after wsDial%:
is called). To set the focus before the
dialog appears (before the call to wsDial%:
) call the
dFOCUS%:
procedure. dFOCUS%:
counts from zero.
For example:
... dINIT dCHOICE blah blah dDATE blah blah dLONG blah blah dFOCUS%:( 1 ) :REM set focus to *second* dialog line (the dDATE) wdDial%: ...
dCLOSE:
procedure to close an asynchronous dialog,
specifying the return value.sDWMAX%:
procedure to set the maximum range of the
dDONEWN%:
dialog control.gDBUF$:
procedure to get the contents of a
dEDIT
control.dlgItem%:
- Return pointer to the data structure for the
given dialog line. Modified dlgFlags:
to use it.zts2lbc$:
and lbc2zts%:
.mod&:
- Integer remainder after integer division.prSetupA:
to the
WDR
Printer Driver Interface module to support asynchronous changing of the
printer settings. Support for asynchronous printing appears to be
impossible.gXXX
and sXXX
procedures to get and
set dialog box items.dTXTSET%:(index%,s$)
procedure renamed to
sTEXT%:(index%,s$)
.dDWSET%:(itm%,value&)
procedure renamed to
sDONEWN%:(itm%,value&)
.dULINE%:(index%,on%)
procedure changed to
dlgFlags:(index%,what%,on%)
that allows setting of things other
than underlining. To obtain the original underlining function, set
what%
to 4, for example:
dlgFlags:(index%,4,on%)
.wsMenu%:
procedure changed, now requires a parameter
(pinit%
) that is a pointer to an integer that contains the
initial selection. If pinit%
is zero, wsMenu%:
operates like MENU
, otherwise it operates like
MENU(init%)
. i.e.:
OPL | Toolbox Equivalent |
---|---|
MENU | wsMenu%:(0) |
LOCAL init% | LOCAL init% |
hlpSync%:(fname$,base&,page&)
procedure removed,
replaced with amLdRsc%:(fname$)
and
amHelp%:(page%,index%)
. Typically you would call
amLdRsc%:
once at the start of your program to set the help
file, then call amHelp%:
as needed to display the help.
Applications that have multiple help files can call amLdRsc%:
multiple times. For the asynchronous implementation, you should return 1
from the keyboard event handler that processes the help keypress (otherwise
the help keypress will be kept and result in the topmost dialog box closing
when leaving help).Old | New |
---|---|
dCHOICE ch%,p$,"x" |
dCHOICE%:(ADDR(ch%),p$,list%) |