11.3 Script Utilities
EntryRef
structure. You will never define structures of this type directly, but you will use pointers to EntryRef
s. The actual content of an EntryRef
is private to PsyScope.
An EntryRef
pointer may be thought of as a pointer to an entry in the script. You use this pointer with various Script Utilities to obtain various values stored in the entry. For instance, if you want to get the first token of and entry called "TestEntry", you would first get an EntryRef *
from LocateEntry()
, and then pass the result to GetATok()
: i.e. GetATok(LocateEntry("TestEntry"), 0)
.
EntryRef
structures are allocated and freed automatically, so you never need to dispose of an EntryRef *
. EntryRef
structures are purged during event loops and between trial compilations; if you need to keep an EntryRef
across such events, you can lock it with UntrashEntry()
. Any number of calls to UntrashEntry()
can be made for a given EntryRef *
, but each call to UntrashEntry()
should be eventually balanced with a call to TrashEntry()
.
Generated with CERN WebMaker