The getMode() Command


Command Summary

Checks the current mode settings.

Command Syntax


Menu Location

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

Calculator Compatibility

This command works on all calculators.

Token Size

2 bytes

The getMode() command checks any one current mode setting. Just give it the name of the mode setting to check, as a string, and it will give you the current value. For example:

:getMode("Complex Format")

The name of the setting is not case-sensitive, but is very typo-sensitive.

In practice, getMode() is almost entirely superseded by setMode() — usually, you don't care about a setting unless you want to change it if it's wrong. In particular, it is silly to do the following:

:If getMode("Angle")≠"RADIAN"
:  setMode("Angle","RADIAN")

In this case, just the setMode() command instruction by itself would have been fine, since changing the mode from radian to radian would've done nothing anyway.

It is also silly to do the following:


It is a noble impulse to try to preserve the old setting and restore it later. However, the same is accomplished more elegantly with (note the { } brackets):


Every string like "Angle" or "FLOAT 12" can be replaced by a numerical equivalent (one that is, for some reason, still given as a string, e.g. "3" or "26"). Using these is shorter, and it has the benefit of being international.

See the Table of Mode Settings to look up these numbers, as well as read about what the various mode settings do.

Error Conditions

260 - Domain error happens when a mode setting or value doesn't exist, at least not with this spelling.

Related Commands

See Also

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