The isClkOn() Command

isclkon.png

Command Summary

Checks if the hardware clock is turned on.

Command Syntax

isClkOn()

Menu Location

This command can't be found in any menu besides the command catalog.

Calculator Compatibility

This command requires a calculator with AMS version 2.07 or higher (it will also work on any TI-89 Titanium or Voyage 200 calculator)

Token Size

3 bytes

The isClkOn() command checks if the calculator's clock (which is used by most time and date commands) is running or stopped. The result of isClkOn() is a truth value — true if the clock is on, and false if the clock is off — which makes it perfect for a condition in commands such as If:

:If isClkOn() Then
: Disp "Clock is running."
:Else
: Disp "Clock is stopped."
:EndIf

The isClkOn() command, though useful, isn't often called for. For instance, there's no need to check if the clock is on if you're planning to turn it on anyway:

:If not isClkOn()
: ClockOn

should just be

:ClockOn

One use for isClkOn() is in functions, which aren't allowed to change the global status of the calculator with commands like ClockOn or ClockOff. Instead, you might do the next best thing, and return an error message if the clock is turned off.

Related Commands

Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-Noncommercial 2.5 License.