TI-BASIC:Getcalc

From Learn @ Cemetech
Jump to navigationJump to search

GETCALC.GIF

Command Summary

Gets a variable from another calculator.

Command Syntax

GetCalc(variable)

(84+ and 84+SE only) GetCalc(variable,portflag)

Menu Location

While editing a program, press:

  1. PRGM to enter the PRGM menu
  2. RIGHT to enter the I/O menu
  3. 9 to choose GetCalc(, or use arrows

Calculator Compatibility

TI-83/84/+/SE

Token Size

2 bytes

The GetCalc( command allows you to make Multiplayer games, where two calculators communicate with each other across a link cable that is connected between them. The GetCalc( command can only receive one variable from another calculator, and the variable can be any variable (a real, list, matrix, string, etc.). The calculator doesn't exchange variable values when the variable is received, but instead replace the variable of the same name on the receiving calculator.

For the GetCalc( command to work correctly, the sending calculator must be in a preemptible state and it cannot be executing an Assembly program. (The sending calculator is the one which is not executing the GetCalc( command.) The two main commands that you should use to ensure this are Pause and Menu(; however, any command that is waiting for user input will also work perfectly fine (such as Prompt and Input).

The GetCalc( command behaves a little differently in the older TI-83 models. If the sending calculator is idle with the Pause or Menu( command, it will automatically "press enter" when the receiving calculator executes GetCalc(. This can be frustrating when in a menu, because it prevents the user's opportunity to make a selection.

However, this can make real-time gaming more possible if used in conjunction with the Pause command. When the receiving calculator receives the variable, it could then execute the Pause command, while the sending calculator automatically exits the power-saving state and could then perform the GetCalc( command. All models after the TI-83 do not automatically exit their power-saving states.

Advanced Uses

The TI-84+ and TI-84+SE will use the USB port if it is connected to a USB cable, otherwise they will use the I/O port. However, you can specify which port you want to use by putting a number after the variable as GetCalc('s second argument: zero to use the USB port if connected to a USB cable, one to use the USB port without checking to see if it's connected, and three to use the I/O port.

Related Commands

See Also