Transmitting variables under program control, Overview of commands, The “chat” program – Texas Instruments PLUS TI-89 User Manual

Page 388

Advertising
background image

Chapter 22: Linking and Upgrading 371

22LINK.DOC TI-89/TI-92 Plus: Linking and Upgrading (English) Susan Gullord Revised: 02/23/01 1:23 PM Printed: 02/23/01 2:20 PM Page 371 of 18

SendCalc

sends a variable to the link port, where a linked calculator

can receive the variable value. The linked calculator must be on the
Home screen or must execute

GetCalc

from a program. If you send to

a

TI

-92

, however, an error occurs if the

TI

-92

executes

GetCalc

from a

program. In this case, you must use

SendChat

instead.

SendChat

, a general alternative to

SendCalc

, is useful if the receiving

calculator is a

TI

-92

(or for a generic chat program that allows a

TI

-89,

TI

-92

, or

TI

-92

Plus to be the receiving calculator).

SendChat

sends a variable only if that variable is compatible with the

TI

-92

,

which is typically true in chat programs. However,

SendChat

will not

send an archived variable, a

TI

-89

or

TI

-92 Plus

graph data base, etc.

The following program uses

GetCalc

and

SendChat

. The program

sets up two loops that let the linked calculators take turns sending
and receiving/displaying a variable named

msg

.

InputStr

lets each

user enter a message in the

msg

variable.

:Chat()
:Prgm
:ClrIO
:Disp "On first unit to send,"," enter 1;","On first to receive,"
:InputStr " enter 0",msg
:If msg="0" Then
: While true
: GetCalc msg
: Disp msg
: InputStr msg
: SendChat msg
: EndWhile
:Else
: While true
: InputStr msg
: SendChat msg
: GetCalc msg
: Disp msg
: EndWhile
:EndIf
:EndPrgm

To synchronize

GetCalc

and

SendChat

, the loops are arranged so that

the receiving unit executes

GetCalc

while the sending unit is waiting

for the user to enter a message.

Transmitting Variables under Program Control

You can use a program containing GetCalc and SendCalc or
SendChat to transmit a variable from one calculator to
another.

Overview of
Commands

The “Chat” Program

Loop executed by the unit that
receives the first message.

Loop executed by the unit that
sends the first message.

Then sets up this
unit to receive and
display msg.

Sets up this unit to
receive and display
the variable msg.

Then lets this user
enter a message in
msg and send it.

Lets this user enter
a message in msg
and send it.

Advertising
This manual is related to the following products: