The date format is YYYYMMDD
, with an optional fractional part defining the
time, as in YYYYMMDD.HHMMSS
.
Note: the date format is intentionally different from the format on the HP-48.
The time format is HH.MMSS
with optional hundredths of a second as
in HH.MMSSCC
.
Set current system date.
The date format is YYYYMMDD
, with an optional fractional part defining the
time, as in YYYYMMDD.HHMMSS
. If the fractional part is zero, then the time is
not changed.
Note: the date format is intentionally different from the format on the HP-48.
Add days to a date. The date format is YYYYMMDD
, with an optional fractional part defining the time, as in YYYYMMDD.HHMMSS
, and an optional unit, as in YYYMMDD_date
.
Set current time from a stack value HH.MMSSCC
.
An HMS value can also be given, as returned by the Time
command.
Convert decimal time to HH.MMSS
format.
Convert time in HH.MMSS
format to decimal time.
Add time in HH.MMSS
format.
Subtract time in HH.MMSS
format
Return system clock in milliseconds
Perform EVAL and measure elapsed time
Return the current system date as a unit object in the form YYYYMMDD_date
.
This displays on the stack according to date format settings, in a way similar
to what is shown in the header, e.g. 23/Feb/2024
or 2024-02-23
.
Return the current system date as a unit object in the form YYYYMMDD_date
.
This displays on the stack according to date format settings, in a way similar
to what is shown in the header, e.g. 23/Feb/2024
or 2024-02-23
.
Number of days between dates.
Return the current system time as a unit object in the form HH.MMSS_hms
.
This displays on the stack as HH:MM:SS
.
Return the Julian day number for the given date and time
Acknowledge oldest alarm (dismiss)
Acknowledge (dismiss) all alarms
Recall specified alarm
Create a new alarm
Delete an existing alarm
Get first alarm due after the given time
Return DB48X version information as text.
▶ "Version information"
Return the number of bytes immediately available in memory, without performing a cleanup of temporary values (garbage collection).
See also: GarbageCollect, FreeMemory
Return the number of bytes available in memory.
Remark: The number returned is only a rough indicator of usable memory. In particular, recovery features consume or release varying amounts of memory with each operation.
Before it can assess the amount of memory available, AvailableMemory
removes
objects in temporary memory that are no longer being used. Like on the HP48, you
can therfore use MEM
DROP
to force garbage collection. However, there is
also a dedicated command for that, GarbageCollect.
See also: FreeMemory, GarbageCollect
Perform a clean-up of temporary objects and return number of bytes reclaimed.
In order to speed up normal operations, temporaries are only discarded when necessary to make room. This clean-up process, also called garbage collection, occurs automatically when memory is full. Since garbage collection can slow down calculator operation at undesired times, you can force it to occur at a desired time by executing GarbageCollect.
See also: FreeMemory, Purge
Return an array containing garbage collector statistics, including:
- The number of garbage collection cycles
- The total number of bytes collected
- The total time spent collecting garbage
- The number of bytes collected during the last collection cycle
- The duration of the last collection cycle
- The number of bytes cleared by temporaries cleaning
Return an array containing runtime statistics, including:
- The time spent running (i.e. the calculator is in high-power state)
- The time spent sleeping (i.e. the calculator is in low-power state)
- The number of times the calculator entered high-power state
Note that the calculator tends to spend more time in active state when on USB power, because of additional animations or more expensive graphical rendering.
Return the size of the object and a hash of its value. On classic RPL systems, teh hash is a 5-nibbles CRC32. On DB48X, the hash is a based integer of the current wordsize corresponding to the binary representation of the object.
For example, the integer 7
hash will be in the form #7xx
, where 7
is the
value of the integer, and xx
represents the integer type, as returned by the
Type command.
X
▶ Hash
Size
Return the type of the object as a numerical value. The value is not guaranteed to be portable across versions of DB48X (and pretty much is guarantteed to not be portable at the current stage of development).
If the CompatibleTypes
setting is active, the returned value roughly matches
the value returned by the HP50G. It always returns 29
for arrays, not 3
(real array) nor 4
(complex array). It returns 1
for both polar and
rectangular complex numbers, irrespective of their precision. 128-bit decimal
values return 21
(extended real), 32-bit and 64-bit return 0
(real number).
The separation between 18
(built-in function) and 19
(built-in command) may
not be accurate.
If the DetailedTypes
setting is active, the return value is negative, and
matches the internal representation precisely. For example, distinct values will
be returned for fractions and expressions.
Note The TypeName command returns the type as text, and
this is less likely to change from one release to the next. DB48X-only code
should favor the use of TypeName
, both for portability and readability.
Return the type of the object as text. For example, 12 type
returns
"integer"
.
Low-level read memory address
Low level write to memory address
Make a new copy of the given object
Turn calculator off programmatically
Display the built-in system setup
Save the machine's state to disk, using the current state if one was previously loaded. This is intended to quickly save the state for example before a system upgrade.
Capture the current state of the screen in a dated file stored on the flash storage under the SCREENS/
directory. This is activated by holding 🟨 and O simultaneously. Pressing the keys one after another activates the DisplayMenu.
Return the current battery voltage as a decimal value.
Returns True
if the calculator is connected to USB power.
Programmers can use this command in a long-running program to alter the frequency of power-hungry operations such as displaying on the screen.
For example, the CollatzConjecture
library program only displays the amount of
memory used when powered by USB:
ⓁCollatzBenchmark
Returns True
if the calculator is running low on battery, which is defined as
having less than 1/4th of the charge between 3000 mV and the value defined in
MinimumBatteryVoltage
.
Programmers can use this command in long-running programs to automatically pause their programs in order to avoid draining the battery and losing memory.
Returns True
if the calculator is running low on battery according to the DMCP
get_lowbat_state()
function. Experimentally, this function is not very
reliable in detecting low-battery conditions. Use LowBattery
instead.
This setting defines the minimum battery voltage in millivolts where the calculator will automatically switch off to preserve battery. The default value is 2600mV, which appears to be safe even with no-brand batteries.
Experimentally, the DM42 can operate at much lower voltages than 2.4V, but some operations become unreliable or even cause a reset. Notably, the calculator may not be able to wake up without rebooting, losing user data in the process.
If the battery goes below MinimumBatteryVoltage
, the calculator will
automatically switch off with a message on the screen requesting to connect to
USB power or to change the battery. Selecting a higher value than the
default can be used to have an early reminder that you need to purchase
replacement batteries.
This setting defines the refresh interval in milliseconds between checks or updates of the battery levels. The default is 5000
(5 seconds).
Note that explicitly calling BatteryVoltage
, USBPowered
or LowBattery
causes the corresponding values to be immediatley refreshed, but does not
necessarily cause the battery status on screen to update.
On hardware calculators, use the DMCP system background display refresh. This is the default setting, and presumably should use less energy.
On hardware calculator, use the software display refresh. This should be used for debugging purpose only.