[Main]
Name=DerefSym
Type=Function
Subtype=ROM Call
Header Files=vat.h
Definition=SYM_ENTRY *DerefSym (HSym Sym);

[ROM Call]
Index=$79

[Description]
Dereferences a symbol.

[Explanation]
DerefSym dereferences the symbol by converting <I>Sym</I> (which is return value from many
TIOS VAT functions) into the actual VAT entry. DerefSym returns a pointer to the entry,
which is a pointer to the structure
of type <A HREF="$$LINK(SYM_ENTRY)">SYM_ENTRY</A>, which represents a VAT entry. Returns
NULL in a case of error. Beware that VAT entries may moved during the heap compression,
so <A HREF="$$LINK(SYM_ENTRY)">SYM_ENTRY</A> pointers may become invalid after the heap compession.
<BR><BR>
DerefSym may be simulated using <A HREF="$$LINK(alloc.h/HeapDeref)">HeapDeref</A>.
For example, the statement
<PRE>SymPtr = DerefSym (hsym);
</PRE>
is equal to the statement
<PRE>SymPtr = (SYM_ENTRY*)((char*)HeapDeref(hsym.folder) + hsym.offset);
</PRE>
I don't know what the best way to find the handle of the main folder is, but one method
which is certainly legal is the following:
<PRE>MainHandle = DerefSym(SymFindHome(SYMSTR("main")))-&gt;handle;
</PRE>
<B>Note:</B> <A HREF="$$LINK(SYM_ENTRY)">SYM_ENTRY</A> structures are usually
not locked, which means that pointers to them will become invalid if a heap
compression occurs. Basically, this means that you can only operate on them
for a short time in which you know that no heap compression can occur.

[References]
In=AddSymToFolder, checkCurrent, EM_moveSymFromExtMem, EM_moveSymToExtMem, EM_twinSymFromExtMem, HSymDel, HSYMtoName, partial_len, VarRecall, VarStore, bascmd.h/cmd_andpic, bascmd.h/cmd_archive, bascmd.h/cmd_blddata, bascmd.h/cmd_custom, bascmd.h/cmd_cyclepic, bascmd.h/cmd_delfold, bascmd.h/cmd_delvar, bascmd.h/cmd_dialog, bascmd.h/cmd_fill, bascmd.h/cmd_get, bascmd.h/cmd_local, bascmd.h/cmd_lock, bascmd.h/cmd_movevar, bascmd.h/cmd_newdata, bascmd.h/cmd_newpic, bascmd.h/cmd_newprob, bascmd.h/cmd_passerr, bascmd.h/cmd_popup, bascmd.h/cmd_rclpic, bascmd.h/cmd_request, bascmd.h/cmd_rplcpic, bascmd.h/cmd_showstat, bascmd.h/cmd_sinreg, bascmd.h/cmd_sorta, bascmd.h/cmd_sortd, bascmd.h/cmd_stogdb, bascmd.h/cmd_toolbar, bascmd.h/cmd_unarchiv, bascmd.h/cmd_unlock, bascmd.h/cmd_xorpic, basfunc.h/push_csolve, basfunc.h/push_czeros, basfunc.h/push_gettype, basfunc.h/push_max, basfunc.h/push_min, basfunc.h/push_nsolve, basfunc.h/push_randpoly, basfunc.h/push_solve, basfunc.h/push_zeros, basop.h/push_indir_name, error.h/ERD_process, estack.h/push_internal_simplify, estack.h/push_parse_text, events.h/handleRclKey, events.h/handleVarLinkKey, files.h/TIOS_FClose: FClose, files.h/TIOS_FDelete: FDelete, files.h/TIOS_FOpen: FOpen, files.h/TIOS_FSetVer: FSetVer, graphing.h/gdb_len, graphing.h/gdb_recall, graphing.h/gdb_store, link.h/OSLinkCmd, link.h/sendcalc, stdio.h/fopen, unknown.h/de_initRes, unknown.h/de_loop, unknown.h/delete_list_element, unknown.h/did_push_approx_inflection_point, unknown.h/did_push_var_val, unknown.h/does_push_fetch, unknown.h/dv_create_graph_titles, unknown.h/EQU_getNameInfo, unknown.h/EQU_select, unknown.h/EQU_setStyle, unknown.h/FindGrFunc, unknown.h/GetStatValue, unknown.h/GM_Derivative, unknown.h/GM_DistArc, unknown.h/GM_Inflection, unknown.h/GM_Integrate, unknown.h/GM_Intersect, unknown.h/GM_Math1, unknown.h/GM_TanLine, unknown.h/gr_add_fldpic, unknown.h/gr_ck_solvergraph, unknown.h/gr_de_value, unknown.h/gr_execute_seq, unknown.h/gr_remove_fldpic, unknown.h/gr_seq_value, unknown.h/gr_stopic, unknown.h/GT_Open, unknown.h/GT_SaveAs, unknown.h/InitDEMem, unknown.h/InitTimeSeq, unknown.h/NG_setup_graph_fun, unknown.h/push_parse_prgm_or_func_text, estack.h/push_simplify, unknown.h/push_user_func, unknown.h/recall_data_var, unknown.h/seqWebInit, unknown.h/setup_more_graph_fun, unknown.h/spike_geo_titles, unknown.h/spike_in_editor, unknown.h/spike_optionD, unknown.h/statFree, unknown.h/store_data_var, unknown.h/tokenize_if_TI_92_or_text, unknown.h/VarStoreLink, unknown.h/_ROM_CALL_437, unknown.h/_ROM_CALL_438, unknown.h/_ROM_CALL_45E, unknown.h/_ROM_CALL_468, unknown.h/_ROM_CALL_4D1
