In case the maximum of #7FFFFFFFh for TOFF for the automatic
timeoff value (see previous post) isn't enough for you, you can
make the 49 series stay on "forever" (assuming that power is
supplied "forever") by storing the empty program \<< \>> in the
reserved variable 'STARTOFF' in the home directory.
When the timeout (whether the default 5 minutes or the number of
ticks specified by TOFF) has elapsed without any activity, by
default, the calculator turns itself off, but if the reserved
variable STARTOFF is found in the home directory, then the object
stored there is executed instead of turning off, but without
entering any command line or anything in the equation writer or
updating the display, although it does rather mess thing up if the
matrix writer is active.
If you want the calculator to actually turn off at the automatic
timeout but "do something" first, then include the command OFF as
the last object in a STARTOFF program. You can also use STARTOFF
to have the calculator turn off after the automatic timeout and
then "do something" as soon as it's turned on again, by making the
OFF command the first object in a STARTOFF program. Or you can
have the calculator "do something" after the automatic timeoff,
then turn off, and then "do something else" as soon as it's turned
on again.
For example:
%%HP: T(3);
@ Example STARTOFF program for 49 series, to be stored in the home
@ directory.
\<< @ Begin program..
"Off " @ Beginning of "Off" string.
TIME @ Time as real number.
+ @ Concatenate real to string.
OFF @ Turn off, remainder of program to be executed
@ when turned on again.
"On " @ Beginning of "On" string.
TIME @ Time as real number.
+ @ Concatenate real to string.
\>> @ End program.
Note that the display isn't automatically updated when STARTOFF is
finished; to actually see the strings from the above program,
after the calculator is on, you have to exit any "special
environment" such as the command line editor, or at least press a
key.
But STARTOFF is executed only for automatic timeouts; what if you
also want to have it executed when you manually turn the
calculator off? Well, you can use the name STARTOFF as the user
key assignment for the RightShift OFF key:
'STARTOFF' 101.3 ASN
But in this case, the command line is entered before executing STARTOFF and the display is
updated afterward; I don't know how to quite duplicate the action of the
automatic timeout. But if a user presses OFF himself, he can be
careful to exit any such "special environments" first
Regards,
James
Edited: 25 Nov 2006, 4:15 p.m.