@ CLKMENU.RPL, by Joe Horn; puts a clock in the CST menu.
DEFINE DOWSTR #0D2F0
{
:: @ label maker
TakeOver @ allow dynamic updating of menu label
$ "Time/Date" DROP @ so that review key shows Time/Date
TOD TOD>t$ @ convert 24-hour time to 12/24-hr string
FORTYONE SysITE @ European time display mode?
:: 2 6 SUB$ TOD ; @ if so, lose leading space & seconds
:: 1 5 SUB$ TOD @ if not, lose seconds
%1- % 12 %MOD %1+ ; @ and convert to 12-hr time
%10 %< IT @ is hour < 10?
:: 2 5 SUB$ ; @ if so, lose leading zero
MakeStdLabel @ turn time$ into menu label
;
{ @ primary & shifted key definitions
:: @ dumps current time & date/dow to stack
TOD TOD>t$ @ time in 12/24-hr format
DATE DUP DOWSTR @ convert date to day-of-week (e.g. "MON")
APPEND_SPACE SWAP
Date>d$ &$ @ append date$ to dow
;
x\->TIME @ left-shift
x\->DATE @ right-shift
}
}