Cmd_Copyvar - Texas Instruments TI-89 Developer's Manual

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

Advertisement

Appendix A: System Routines — Variables

cmd_copyvar

Declaration:
void cmd_copyvar (EStackIndex OldSym , EStackIndex NewSym )
Category(ies):
Variables
Description:
Copy a variable. This is the TI-BASIC command CopyVar. As specified in
section 13.3. Managing Variables, these routines should be used instead
of the low-level Symbol Table routines.
Inputs:
OldSym
NewSym — EStackIndex of destination variable.
Outputs:
May throw these errors (plus any that VarRecall or VarStore might throw):
ER_VAR_IN_USE
ER_DUPLICATE_VAR_NAME — Destination same as source.
ER_UNDEFINED_VAR
ER_PROTECTED
ER_MEMORY
Assumptions:
None
Side Effects:
May cause heap compression.
Availability:
On AMS 1.05 and higher.
TI-89 / TI-92 Plus
Differences:
None
See Also:
VarRecall, VarStore, TokenizeSym, TokenizeName
Example:
This example copies the variable sourceName to destName .
EStackIndex esSource, oldTop = top_estack;
BYTE sourceName[MAX_SYM_LEN], destName[MAX_SYM_LEN];
TRY
if (TokenizeSymName( sourceName, 0 ) == NULL)
ER_THROW( INVALID_PATHNAME_ERROR );
esSource = top_estack;
if (TokenizeSymName( destName, 0 ) == NULL)
ER_THROW( INVALID_PATHNAME_ERROR );
cmd_copyvar( esSource, top_estack );
top_estack = oldTop; /* restore top of ESTACK */
ONERR
top_estack = oldTop; /* restore top of ESTACK */
PASS; /* pass error on up to caller */
ENDTRY
TI-89 / TI-92 Plus Developer Guide
— EStackIndex of source variable.
— Source/destination is in-use.
— Source variable not found.
— Invalid copy to a system variable.
— Not enough memory for copying.
Not for Distribution
1131
Beta Version January 26, 2001

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

Ti-92 plusTi-92 plus

Table of Contents