Managing Variables - Texas Instruments TI-89 Developer's Manual

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

Advertisement

134
that the FOpen calls to open the files will not invalidate any previous HSYMs
since the variables will have already been created.
13.3.

Managing Variables

All variables are stored in the symbol table. The symbol table is setup as follows.
There is one home folder which may contain variables or folders, although it only
contains folders in the current system. It is a dynamically (in the heap)
maintained array of SYM_ENTRYs. In the case of a folder the value pointer
points to another dynamically allocated array of SYM_ENTRYs (one level)
otherwise it points to the symbols value in the heap. Folder main always exists in
this home folder and cannot be deleted. Variable and folder names are eight
characters maximum. Names are arranged alphabetically within each array of
SYM_ENTRYs. When a variable whose data is stored in Flash is executed or
displayed in an application (that is, it is "in-use"), a copy of it is stored in RAM
and a duplicate SYM_ENTRY (called a twin) is temporarily created immediately
preceding the original SYM_ENTRY.
The SYM_ENTRY structure is defined as follows.
typedef struct {
BYTE Name[8];
BYTE MUST_BE_0;
BYTE Version;
FLAG_TYPE Flags;
HANDLE hVal;
}
SYM_ENTRY;
Name is a one to eight byte zero-terminated name.
Version is set by the system to one of the values: TV_TI_92, TV_PARM ,
TV_INTERNAL, TV_NGIN, TV_SPAM, TV_CRAM, TV_3RDPARTYAPP,
TV_SCRAM.
Flags (type WORD) may be one of the values: GRAPH_REF1,
GRAPH_REF2, SF_STAT_REF, SF_LOCK, SF_INUSE, SF_SELECTED,
SF_RECEIVED, SF_FOLDER, SF_INVIEW, SF_EXTMEM, SF_EM_TWIN,
SF_COLLAPSE, SF_PARM. The system normally handles the flags for a
symbol. An app may set the SF_INUSE flag bit to signal it is using a variable
and that it should not be used by another app.
VAR_LINK will not display any variables with their SF_INUSE bit set or those
that have an hVal of NULL. Setting the SF_LOCK bit will prevent VarStore
from writing to the variable.
The hVal is the handle of the data for the symbol.
In general, symbol table routines do not return direct pointers to SYM_ENTRYs
(the exceptions being SymFindFirst, SymFindNext, and SymFindPrev).
TI-89 / TI-92 Plus Developer Guide
Chapter 13: Memory Management
Not for Distribution
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