[7.28] Use Long Strings With Setmode() In Custom Menus - Texas Instruments TI-89 Tip List

Graphing calculator
Hide thumbs Also See for TI-89:
Table of Contents

Advertisement

subdeg()
endif
However, this will work since the test strings are in all capital letters:
if getmode("angle")="RADIAN" then
subrad()
elseif getmode("angle")="DEGREE" then
subdeg()
endif

[7.28] Use long strings with setMode() in custom menus

The Custom menu structure lets you customize the 89/92+ for more efficient operation. You can
replace the function key menu tabs at the top of the screen with more useful operations. However,
there is a limit to the length of the strings you can use in the Item argument. This limit prevents the use
of the long strings needed for some of the setMode() function arguments. The solution to this dilemma
is to use the number codes for the setMode() arguments, instead of the strings themselves.
Suppose we want to make a custom menu to set the Exact/Approx modes to Auto, Exact or
Approximate. You might try this program, but it will not work:
custom1()
Prgm
custom
title "Modes"
item "setmode(""Exact/Approx"",""Auto"")"
item "setmode(""Exact/Approx"",""Exact"")"
item "setmode(""Exact/Approx"",""Approximate"")"
endcustm
custmon
EndPrgm
The string for the second Item line, to set the mode to Exact, causes a "Dimension" error because the
string is too long. The solution is to create shorter strings by using the number string codes for
setMode(), instead of the strings themselves. These codes are listed on page 584 of the online 89/92+
Guidebook.
Note also the use of the double quote marks around the item strings. These are used to embed double
quotes in the Item arguments, which are themselves strings.
This is how the program looks using the codes instead of the strings:
custom1()
Prgm
custom
title "Modes"
item "setmode(""14"",""1"")"
item "setmode(""14"",""2"")"
item "setmode(""14"",""3"")"
endcustm
custmon
<- FAILS HERE
7 - 26

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

Ti-92+

Table of Contents