WIDTH and HEIGHT [S][DISP][^] (softkey 5 and 6).
These allow querying the resolution of the graphics display.
The DM42 does not know these commands, but two virtual variables ResX and ResY.
However, it is possible to write a program to run on Free42, Plus42 and DM42 without changes.
You can copy the followng code and paste it in Free42 or Plus42 (on Android, or on your PC). If you import the resulting .raw file in DM42 WIDTH will apears as XROM 09,50
Code: Select all
00 { 30-Byte Prgm }
01▸LBL "ResX"
02 SF 25
03 WIDTH
04 FS?C 25
05 RTN
06 SF 25
07 RCL "ResX"
08 FS?C 25
09 RTN
10 131
11 END
DM42 displays XROM 09,51 instead of HEIGHT
But both programs are working as expected.
Code: Select all
00 { 29-Byte Prgm }
01▸LBL "ResY"
02 SF 25
03 HEIGHT
04 FS?C 25
05 RTN
06 SF 25
07 RCL "ResY"
08 FS?C 25
09 RTN
10 16
11 END
It allows to change a condition like e.g. X=0?
X=0?
SKIP
is equivalent to
x<>0?
It becomes useful when using a condition that has no inverse.
For example, after the HEAD command the following statement is skipped only if the list (or string) in the argument is empty.
In certain cases, this can save a GTO and an LBL, for example.
As follows a replacement for SKIP can be implemented on DM42 with the current firmware.
Code: Select all
00 { 10-Byte Prgm }
01▸LBL "SKIP"
02 RTNNO
03 END
Code: Select all
00 { 35-Byte Prgm }
01▸LBL ".TMP"
02 XSTR "TEST!"
03 0
04▸LBL 00
05 HEAD ST Y
06 XEQ "SKIP"
07 RTN
08 C→N
09 +
10 GTO 00
11 END