-
Notifications
You must be signed in to change notification settings - Fork 16
/
vat.html
1818 lines (1663 loc) · 115 KB
/
vat.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<TITLE>vat.h</TITLE>
<STYLE TYPE="TEXT/CSS">
<!--
.IE3-DUMMY { CONT-SIZE: 100%; }
BODY { FONT-FAMILY: Verdana,Arial,Helvetica,Sans-Serif; BACKGROUND-COLOR: #E0E0E0; }
P { FONT-FAMILY: Verdana,Arial,Helvetica,Sans-Serif; }
H1 { FONT-FAMILY: Verdana,Arial,Helvetica,Sans-Serif; }
H2 { FONT-FAMILY: Verdana,Arial,Helvetica,Sans-Serif; }
H3 { FONT-FAMILY: Verdana,Arial,Helvetica,Sans-Serif; }
H4 { FONT-FAMILY: Verdana,Arial,Helvetica,Sans-Serif; }
H5 { FONT-FAMILY: Verdana,Arial,Helvetica,Sans-Serif; }
H6 { FONT-FAMILY: Verdana,Arial,Helvetica,Sans-Serif; }
UL { FONT-FAMILY: Verdana,Arial,Helvetica,Sans-Serif; }
TD { FONT-FAMILY: Verdana,Arial,Helvetica,Sans-Serif; BACKGROUND-COLOR: #FFFFFF; }
.NOBORDER { BACKGROUND-COLOR: #E0E0E0; PADDING: 0pt; }
.NOBORDER TD { FONT-FAMILY: Verdana,Arial,Helvetica,Sans-Serif; BACKGROUND-COLOR: #E0E0E0; PADDING: 0pt; }
.CODE { FONT-FAMILY: Courier New; }
-->
</STYLE>
</HEAD>
<BODY TEXT="#000000" BGCOLOR="#E0E0E0">
<FONT SIZE="5"><B>The <vat.h> Header File</B></FONT>
<HR>
<P><B>Routines for accessing the variable allocation table</B></P>
<H3><U>Functions</U></H3>
<DL INDENT="20"><DT><B><A HREF="#dollar">$</A></B><DD>Defines a constant VAT string.<IMG WIDTH="1" HEIGHT="20" ALIGN="TOP"><DT><B><A HREF="#AddSymToFolder">AddSymToFolder</A></B><DD>Adds a symbol in a given folder.<IMG WIDTH="1" HEIGHT="20" ALIGN="TOP"><DT><B><A HREF="#checkCurrent">checkCurrent</A></B><DD>Check for the existence of a symbol.<IMG WIDTH="1" HEIGHT="20" ALIGN="TOP"><DT><B><A HREF="#CheckLinkLockFlag">CheckLinkLockFlag</A></B><DD>Prevents a variable to be overwritten through link transfer if this is not allowed.<IMG WIDTH="1" HEIGHT="20" ALIGN="TOP"><DT><B><A HREF="#CheckReservedName">CheckReservedName</A></B><DD>Checks for graph functions and other special variable names.<IMG WIDTH="1" HEIGHT="20" ALIGN="TOP"><DT><B><A HREF="#CheckSysFunc">CheckSysFunc</A></B><DD>Checks for graph functions and other special variable names.<IMG WIDTH="1" HEIGHT="20" ALIGN="TOP"><DT><B><A HREF="#ClearUserDef">ClearUserDef</A></B><DD>Clears TI-Basic program/function status flags.<IMG WIDTH="1" HEIGHT="20" ALIGN="TOP"><DT><B><A HREF="#DataTypeNames">DataTypeNames</A></B><DD>Returns a pointer to a static string representing the type of the tag passed.<IMG WIDTH="1" HEIGHT="20" ALIGN="TOP"><DT><B><A HREF="#DerefSym">DerefSym</A></B><DD>Dereferences a symbol.<IMG WIDTH="1" HEIGHT="20" ALIGN="TOP"><DT><B><A HREF="#EM_moveSymFromExtMem">EM_moveSymFromExtMem</A></B><DD>Moves a symbol from the archive memory to the RAM.<IMG WIDTH="1" HEIGHT="20" ALIGN="TOP"><DT><B><A HREF="#EM_moveSymToExtMem">EM_moveSymToExtMem</A></B><DD>Moves a symbol from the RAM to the archive memory.<IMG WIDTH="1" HEIGHT="20" ALIGN="TOP"><DT><B><A HREF="#EM_twinSymFromExtMem">EM_twinSymFromExtMem</A></B><DD>Creates a twin symbol, then copies a symbol from the archive memory to it.<IMG WIDTH="1" HEIGHT="20" ALIGN="TOP"><DT><B><A HREF="#EX_stoBCD">EX_stoBCD</A></B><DD>Stores a floating point value into a variable.<IMG WIDTH="1" HEIGHT="20" ALIGN="TOP"><DT><B><A HREF="#FindProgramVar">FindProgramVar</A></B><DD>Finds the running program's variable.<IMG WIDTH="1" HEIGHT="20" ALIGN="TOP"><DT><B><A HREF="#FindSymInFolder">FindSymInFolder</A></B><DD>Finds a symbol in a given folder.<IMG WIDTH="1" HEIGHT="20" ALIGN="TOP"><DT><B><A HREF="#FolderAdd">FolderAdd</A></B><DD>Creates a folder.<IMG WIDTH="1" HEIGHT="20" ALIGN="TOP"><DT><B><A HREF="#FolderAddTemp">FolderAddTemp</A></B><DD>Creates a temporary folder.<IMG WIDTH="1" HEIGHT="20" ALIGN="TOP"><DT><B><A HREF="#FolderClear">FolderClear</A></B><DD>Deletes all files in the folder.<IMG WIDTH="1" HEIGHT="20" ALIGN="TOP"><DT><B><A HREF="#FolderCount">FolderCount</A></B><DD>Determines a number of symbols in a folder.<IMG WIDTH="1" HEIGHT="20" ALIGN="TOP"><DT><B><A HREF="#FolderCur">FolderCur</A></B><DD>Sets the currently active folder.<IMG WIDTH="1" HEIGHT="20" ALIGN="TOP"><DT><B><A HREF="#FolderCurTemp">FolderCurTemp</A></B><DD>Sets the current temporary folder for storing local symbols.<IMG WIDTH="1" HEIGHT="20" ALIGN="TOP"><DT><B><A HREF="#FolderDel">FolderDel</A></B><DD>Deletes a folder, including all files in it.<IMG WIDTH="1" HEIGHT="20" ALIGN="TOP"><DT><B><A HREF="#FolderDelAllTemp">FolderDelAllTemp</A></B><DD>Deletes a block of temporary folders.<IMG WIDTH="1" HEIGHT="20" ALIGN="TOP"><DT><B><A HREF="#FolderDelTemp">FolderDelTemp</A></B><DD>Deletes a temporary folder.<IMG WIDTH="1" HEIGHT="20" ALIGN="TOP"><DT><B><A HREF="#FolderFind">FolderFind</A></B><DD>Checks whether a folder exists.<IMG WIDTH="1" HEIGHT="20" ALIGN="TOP"><DT><B><A HREF="#FolderGetCur">FolderGetCur</A></B><DD>Determines the current active folder.<IMG WIDTH="1" HEIGHT="20" ALIGN="TOP"><DT><B><A HREF="#FolderOp">FolderOp</A></B><DD>Locks or unlocks a folder table.<IMG WIDTH="1" HEIGHT="20" ALIGN="TOP"><DT><B><A HREF="#FolderRename">FolderRename</A></B><DD>Renames a folder.<IMG WIDTH="1" HEIGHT="20" ALIGN="TOP"><DT><B><A HREF="#GetDataType">GetDataType</A></B><DD>Returns the data type for a given tag pointed to by <I>tagptr</I>.<IMG WIDTH="1" HEIGHT="20" ALIGN="TOP"><DT><B><A HREF="#GetFuncPrgmBodyPtr">GetFuncPrgmBodyPtr</A></B><DD>Returns a pointer to a TI-Basic function/program body.<IMG WIDTH="1" HEIGHT="20" ALIGN="TOP"><DT><B><A HREF="#GetTagStr">GetTagStr</A></B><DD>Returns the address of the string representing the special tag pointed to by <I>tag</I>.<IMG WIDTH="1" HEIGHT="20" ALIGN="TOP"><DT><B><A HREF="#HSymDel">HSymDel</A></B><DD>Deletes a symbol pointed to by HSym.<IMG WIDTH="1" HEIGHT="20" ALIGN="TOP"><DT><B><A HREF="#HSYMtoName">HSYMtoName</A></B><DD>Determines a full path of a symbol.<IMG WIDTH="1" HEIGHT="20" ALIGN="TOP"><DT><B><A HREF="#is_pathname">is_pathname</A></B><DD>Checks if argument points to a pathname.<IMG WIDTH="1" HEIGHT="20" ALIGN="TOP"><DT><B><A HREF="#IsMainFolderStr">IsMainFolderStr</A></B><DD>Checks whether a name is the name of the main folder.<IMG WIDTH="1" HEIGHT="20" ALIGN="TOP"><DT><B><A HREF="#MakeHSym">MakeHSym</A></B><DD>Makes a HSym structure.<IMG WIDTH="1" HEIGHT="20" ALIGN="TOP"><DT><B><A HREF="#partial_len">partial_len</A></B><DD>Queries information about the Data Editor.<IMG WIDTH="1" HEIGHT="20" ALIGN="TOP"><DT><B><A HREF="#QSysProtected">QSysProtected</A></B><DD>Checks if a given tag represents a system-protected variable type.<IMG WIDTH="1" HEIGHT="20" ALIGN="TOP"><DT><B><A HREF="#ResetSymFlags">ResetSymFlags</A></B><DD>Clears all VAT symbols flags.<IMG WIDTH="1" HEIGHT="20" ALIGN="TOP"><DT><B><A HREF="#SetOK">SetOK</A></B><DD>Changes the system variable <CODE>'OK'</CODE>.<IMG WIDTH="1" HEIGHT="20" ALIGN="TOP"><DT><B><A HREF="#SmapTypeStrings">SmapTypeStrings</A></B><DD>Returns the 3-4 character description of a variable type.<IMG WIDTH="1" HEIGHT="20" ALIGN="TOP"><DT><B><A HREF="#StrToTokN">StrToTokN</A></B><DD>Converts a C string to a token.<IMG WIDTH="1" HEIGHT="20" ALIGN="TOP"><DT><B><A HREF="#SymAdd">SymAdd</A></B><DD>Adds a symbol.<IMG WIDTH="1" HEIGHT="20" ALIGN="TOP"><DT><B><A HREF="#SymAddMain">SymAddMain</A></B><DD>Adds a symbol in the main folder.<IMG WIDTH="1" HEIGHT="20" ALIGN="TOP"><DT><B><A HREF="#SymAddTwin">SymAddTwin</A></B><DD>Creates a twin symbol.<IMG WIDTH="1" HEIGHT="20" ALIGN="TOP"><DT><B><A HREF="#SymCmp">SymCmp</A></B><DD>Compares two symbol names.<IMG WIDTH="1" HEIGHT="20" ALIGN="TOP"><DT><B><A HREF="#SymCpy0">SymCpy0</A></B><DD>Copies a symbol name with putting zero byte at the end.<IMG WIDTH="1" HEIGHT="20" ALIGN="TOP"><DT><B><A HREF="#SymCpy">SymCpy</A></B><DD>Copies a symbol name.<IMG WIDTH="1" HEIGHT="20" ALIGN="TOP"><DT><B><A HREF="#SymDel">SymDel</A></B><DD>Deletes a symbol.<IMG WIDTH="1" HEIGHT="20" ALIGN="TOP"><DT><B><A HREF="#SymDelTwin">SymDelTwin</A></B><DD>Deletes a twin symbol.<IMG WIDTH="1" HEIGHT="20" ALIGN="TOP"><DT><B><A HREF="#SymFind">SymFind</A></B><DD>Finds a symbol.<IMG WIDTH="1" HEIGHT="20" ALIGN="TOP"><DT><B><A HREF="#SymFindFirst">SymFindFirst</A></B><DD>Begins looping through the VAT.<IMG WIDTH="1" HEIGHT="20" ALIGN="TOP"><DT><B><A HREF="#SymFindFolderName">SymFindFolderName</A></B><DD>Returns an actual folder name during browsing through the VAT table.<IMG WIDTH="1" HEIGHT="20" ALIGN="TOP"><DT><B><A HREF="#SymFindHome">SymFindHome</A></B><DD>Finds a folder.<IMG WIDTH="1" HEIGHT="20" ALIGN="TOP"><DT><B><A HREF="#SymFindMain">SymFindMain</A></B><DD>Finds a symbol in the main folder.<IMG WIDTH="1" HEIGHT="20" ALIGN="TOP"><DT><B><A HREF="#SymFindNext">SymFindNext</A></B><DD>Finds the next entry in the VAT table.<IMG WIDTH="1" HEIGHT="20" ALIGN="TOP"><DT><B><A HREF="#SymFindPrev">SymFindPrev</A></B><DD>Finds the previous entry in the VAT table.<IMG WIDTH="1" HEIGHT="20" ALIGN="TOP"><DT><B><A HREF="#SymFindPtr">SymFindPtr</A></B><DD>Finds a symbol and returns a pointer to the VAT entry.<IMG WIDTH="1" HEIGHT="20" ALIGN="TOP"><DT><B><A HREF="#SymMove">SymMove</A></B><DD>Moves a symbol.<IMG WIDTH="1" HEIGHT="20" ALIGN="TOP"><DT><B><A HREF="#SYMSTR">SYMSTR</A></B><DD>Defines a VAT string.<IMG WIDTH="1" HEIGHT="20" ALIGN="TOP"><DT><B><A HREF="#SymSysVar">SymSysVar</A></B><DD>Checks for a system-reserved variable name.<IMG WIDTH="1" HEIGHT="20" ALIGN="TOP"><DT><B><A HREF="#TempFolderName">TempFolderName</A></B><DD>Creates a temporary folder name.<IMG WIDTH="1" HEIGHT="20" ALIGN="TOP"><DT><B><A HREF="#TokToStrN">TokToStrN</A></B><DD>Converts a token to a C string.<IMG WIDTH="1" HEIGHT="20" ALIGN="TOP"><DT><B><A HREF="#ValidateSymName">ValidateSymName</A></B><DD>Checks for a valid VAT name symbol.<IMG WIDTH="1" HEIGHT="20" ALIGN="TOP"><DT><B><A HREF="#VarRecall">VarRecall</A></B><DD>A higher-level variant of <A HREF="#SymFind">SymFind</A>.<IMG WIDTH="1" HEIGHT="20" ALIGN="TOP"><DT><B><A HREF="#VarStore">VarStore</A></B><DD>High-level function to store values into variables.</DL>
<H3><U>Constants</U></H3>
<DL INDENT="20"><DT><B><A HREF="alloc.html#H_NULL">H_NULL</A></B><DD>A null-handle value.<IMG WIDTH="1" HEIGHT="20" ALIGN="TOP"><DT><B><A HREF="#HS_NULL">HS_NULL</A></B><DD>A null symbol constant.<IMG WIDTH="1" HEIGHT="20" ALIGN="TOP"><DT><B><A HREF="alloc.html#NULL">NULL</A></B><DD>A null-pointer value.</DL>
<H3><U>Predefined Types</U></H3>
<DL INDENT="20"><DT><B><A HREF="alloc.html#Bool">Bool</A></B><DD>An enumeration to describe true or false values.<IMG WIDTH="1" HEIGHT="20" ALIGN="TOP"><DT><B><A HREF="estack.html#CESI">CESI</A></B><DD>Represents a pointer to a constant expression.<IMG WIDTH="1" HEIGHT="20" ALIGN="TOP"><DT><B><A HREF="#CompatFlags">CompatFlags</A></B><DD>An enumeration for describing possible compatibility flags in the <A HREF="#SYM_ENTRY">SYM_ENTRY</A> structure.<IMG WIDTH="1" HEIGHT="20" ALIGN="TOP"><DT><B><A HREF="estack.html#ESI">ESI</A></B><DD>Represents an index of a value on the TIOS expression stack.<IMG WIDTH="1" HEIGHT="20" ALIGN="TOP"><DT><B><A HREF="estack.html#ESQ">ESQ</A></B><DD>Represents a quantum within an expression.<IMG WIDTH="1" HEIGHT="20" ALIGN="TOP"><DT><B><A HREF="#ExtendedSysTypes">ExtendedSysTypes</A></B><DD>Describes system variable types.<IMG WIDTH="1" HEIGHT="20" ALIGN="TOP"><DT><B><A HREF="#FindOptions">FindOptions</A></B><DD>Describes options for <A HREF="#SymFindFirst">SymFindFirst</A> and <A HREF="files.html#TIOS_FFindFirst">FFindFirst</A>.<IMG WIDTH="1" HEIGHT="20" ALIGN="TOP"><DT><B><A HREF="#FolderOpFlags">FolderOpFlags</A></B><DD>An enumeration for describing possible options for the <A HREF="#FolderOp">FolderOp</A> function.<IMG WIDTH="1" HEIGHT="20" ALIGN="TOP"><DT><B><A HREF="#FolderStats">FolderStats</A></B><DD>An enumeration for describing possible results of the <A HREF="#FolderFind">FolderFind</A> function.<IMG WIDTH="1" HEIGHT="20" ALIGN="TOP"><DT><B><A HREF="gdraw.html#GraphModes">GraphModes</A></B><DD>Describes different graphing modes.<IMG WIDTH="1" HEIGHT="20" ALIGN="TOP"><DT><B><A HREF="alloc.html#HANDLE">HANDLE</A></B><DD>Represents a handle associated with an allocated memory block.<IMG WIDTH="1" HEIGHT="20" ALIGN="TOP"><DT><B><A HREF="#HSym">HSym</A></B><DD>A structure representing a symbol reference.<IMG WIDTH="1" HEIGHT="20" ALIGN="TOP"><DT><B><A HREF="#HSYM_upper">HSYM</A></B><DD>An alias for <A HREF="#HSym">HSym</A>.<IMG WIDTH="1" HEIGHT="20" ALIGN="TOP"><DT><B><A HREF="estack.html#MULTI_EXPR">MULTI_EXPR</A></B><DD>Describes a multi-expression, which is processed as a separate expression stack.<IMG WIDTH="1" HEIGHT="20" ALIGN="TOP"><DT><B><A HREF="#SYM_ENTRY">SYM_ENTRY</A></B><DD>A structure representing a VAT symbol entry.<IMG WIDTH="1" HEIGHT="20" ALIGN="TOP"><DT><B><A HREF="estack.html#SYM_STR">SYM_STR</A></B><DD>Represents a pointer to the terminating zero byte of a string.<IMG WIDTH="1" HEIGHT="20" ALIGN="TOP"><DT><B><A HREF="#SymFlags">SymFlags</A></B><DD>An enumeration for easy access to flags in VAT symbol entries.<IMG WIDTH="1" HEIGHT="20" ALIGN="TOP"><DT><B><A HREF="#SystemDataTypes">SystemDataTypes</A></B><DD>Describes valid variable types in the "Var-Link" dialog, and for the <A HREF="#GetDataType">GetDataType</A> and <A HREF="#SmapTypeStrings">SmapTypeStrings</A> functions.<IMG WIDTH="1" HEIGHT="20" ALIGN="TOP"><DT><B><A HREF="#VarRecallFlags">VarRecallFlags</A></B><DD>A collection of flags used in <A HREF="#VarRecall">VarRecall</A>.<IMG WIDTH="1" HEIGHT="20" ALIGN="TOP"><DT><B><A HREF="#VarStoreFlags">VarStoreFlags</A></B><DD>Describes possible flags for <A HREF="#VarStore">VarStore</A>.</DL>
<HR>
<H3><A NAME="dollar"><U>$</U></A></H3>
<P><TABLE BORDER="1" CELLPADDING="2"><TR><TD CLASS="CODE"><B><A HREF="cpp.html#SEC10">#define</A></B> $(s) (SYMSTR (#s))</TD></TR></TABLE></P>
<P><B>Defines a constant VAT string.</B></P>
<P>This macro constructor has been superseded by the function-like macro
<A HREF="#SYMSTR">SYMSTR</A>.</P>
<HR>
<H3><A NAME="AddSymToFolder"><U>AddSymToFolder</U></A></H3>
<P><TABLE BORDER="1" CELLPADDING="2"><TR><TD CLASS="CODE"><A HREF="#HSym">HSym</A> AddSymToFolder (<A HREF="estack.html#SYM_STR">SYM_STR</A> SymName, <A HREF="estack.html#SYM_STR">SYM_STR</A> FolderName);</TD></TR></TABLE></P>
<P><B>Adds a symbol in a given folder.</B></P>
<P>AddSymToFolder acts like <A HREF="#SymAdd">SymAdd</A>, but adds the VAT entry
in the folder given by <I>FolderName</I>. See <A HREF="#SymAdd">SymAdd</A> and
<A HREF="#SYMSTR">SYMSTR</A>
for more info and rules about <I>SymName</I> and <I>FolderName</I>.
<BR><BR>
<B>Note:</B> This routine is a bit buggy: if the folder <I>FolderName</I> does not
exist, the behavior of this routine is very uncertain, and may result with a crash.</P>
<HR>
<H3><A NAME="checkCurrent"><U>checkCurrent</U></A></H3>
<P><TABLE BORDER="1" CELLPADDING="2"><TR><TD CLASS="CODE"><A HREF="#HSym">HSym</A> checkCurrent (<A HREF="estack.html#SYM_STR">SYM_STR</A> SymName, <A HREF="estack.html#ESQ">ESQ</A> Type);</TD></TR></TABLE></P>
<P><B>Check for the existence of a symbol.</B></P>
<P>checkCurrent makes sure the given symbol exists and matches the requested tag
<I>Type</I>. <I>SymName</I> is the symbol name (see
<A HREF="#SYMSTR">SYMSTR</A> for rules about <I>SymName</I>), and
<I>Type</I> is the requested tag type (see
<A HREF="dialogs.html#VarNew">VarNew</A> for a list of valid tags). checkCurrent
returns the <A HREF="#HSym">HSym</A> of the VAT entry if it exists and
matches the requested tag type, otherwise it returns
<A HREF="#HS_NULL">HS_NULL</A>. For example, the text editor
uses checkCurrent when it is told to edit the current text variable, to make
sure the previous name entered by the user still exists and is a text
variable. If it is not then it executes the code to prompt the user for a new
text variable to edit.</P>
<HR>
<H3><A NAME="CheckLinkLockFlag"><U>CheckLinkLockFlag</U></A></H3>
<P><TABLE BORDER="1" CELLPADDING="2"><TR><TD CLASS="CODE"><B><A HREF="keywords.html#void">void</A></B> CheckLinkLockFlag (<B><A HREF="keywords.html#const">const</A></B> <A HREF="#SYM_ENTRY">SYM_ENTRY</A> *FuncSymEntry);</TD></TR></TABLE></P>
<P><B>Prevents a variable to be overwritten through link transfer if this is not allowed.</B></P>
<P>If <I>FuncSymEntry</I> is a pointer to the VAT entry of TI-Basic program or function
variable, then this function sets or clears the link lock flag which is
embedded in the program or function variable itself, according to the
'archived' and 'locked' bits in the VAT entry. This prevents the variable to
be overwritten through link transfer if this is not permitted. Otherwise
this function does nothing.</P>
<HR>
<H3><A NAME="CheckReservedName"><U>CheckReservedName</U></A></H3>
<P><TABLE BORDER="1" CELLPADDING="2"><TR><TD CLASS="CODE"><B><A HREF="keywords.html#short">short</A></B> CheckReservedName (<A HREF="estack.html#SYM_STR">SYM_STR</A> SymName);</TD></TR></TABLE></P>
<P><B>Checks for graph functions and other special variable names.</B></P>
<P>CheckReservedName checks whether <I>SymName</I> is a graph function or
another special variable name. It returns zero if this is not the case,
otherwise it returns the type of the variable. This routine works in the same
way as <A HREF="#CheckSysFunc">CheckSysFunc</A>; the only differences
are that <I>SymName</I> is a tokenized name, and that the function may also
return <A HREF="#ExtendedSysTypes">R_SYSVAR</A>.
<BR><BR>
Precisely, this function returns values from either
<A HREF="gdraw.html#GraphModes">GraphModes</A> or
<A HREF="#ExtendedSysTypes">ExtendedSysTypes</A>, in addition to zero:
<BR><BR>
<TABLE BORDER CELLPADDING="3">
<TR>
<TD>GR_FUNC</TD>
<TD>"y1".."y99"</TD>
</TR>
<TR>
<TD>GR_PAR</TD>
<TD>"xt1".."xt99", "yt1".."yt99"</TD>
</TR>
<TR>
<TD>GR_POL</TD>
<TD>"r1".."r99"</TD>
</TR>
<TR>
<TD>GR_SEQ</TD>
<TD>"u1".."u99"</TD>
</TR>
<TR>
<TD>GR_3D</TD>
<TD>"z1".."z99"</TD>
</TR>
<TR>
<TD>GR_DE</TD>
<TD>"y'1".."y'99"</TD>
</TR>
<TR>
<TD>SEQ_INITC</TD>
<TD>"ui1".."ui99"</TD>
</TR>
<TR>
<TD>DE_INITC</TD>
<TD>"yi1".."yi99"</TD>
</TR>
<TR>
<TD>DR_FLDPIC</TD>
<TD>"FldPic"</TD>
</TR>
<TR>
<TD>SOLVER_SYS_VARS</TD>
<TD>"Exp", "Eqn"</TD>
</TR>
<TR>
<TD VALIGN="TOP">UNIT_VAR</TD>
<TD>name with a leading underscore</TD>
</TR>
<TR>
<TD>C_COL</TD>
<TD>"c1".."c99"</TD>
</TR>
<TR>
<TD>R_REGEQ</TD>
<TD>"RegEq"</TD>
</TR>
<TR>
<TD VALIGN="TOP">R_SYSVAR</TD>
<TD>another system variable (see <A HREF="estack.html#EXT_SYSTEM_TAG">EXT_SYSTEM_TAG</A>)</TD>
</TR>
</TABLE>
<BR>
This function calls <A HREF="#TokToStrN">TokToStrN</A> and <A HREF="#CheckSysFunc">CheckSysFunc</A>.</P>
<P>See also: <A HREF="#CheckSysFunc">CheckSysFunc</A>, <A HREF="#SymSysVar">SymSysVar</A></P>
<HR>
<H3><A NAME="CheckSysFunc"><U>CheckSysFunc</U></A></H3>
<P><TABLE BORDER="1" CELLPADDING="2"><TR><TD CLASS="CODE"><B><A HREF="keywords.html#short">short</A></B> CheckSysFunc (<B><A HREF="keywords.html#const">const</A></B> <B><A HREF="keywords.html#int">char</A></B> *VarName, <B><A HREF="keywords.html#short">unsigned</A></B> <B><A HREF="keywords.html#short">short</A></B> *Index);</TD></TR></TABLE></P>
<P><B>Checks for graph functions and other special variable names.</B></P>
<P>CheckSysFunc checks whether <I>VarName</I> (an ordinary C string) is a
graph function or another special variable name. It returns zero if this is
not the case, otherwise it returns the type of the variable.
<BR><BR>
Precisely, this function returns values from either
<A HREF="gdraw.html#GraphModes">GraphModes</A> or
<A HREF="#ExtendedSysTypes">ExtendedSysTypes</A>, in addition to zero:
<BR><BR>
<TABLE BORDER CELLPADDING="3">
<TR>
<TD>GR_FUNC</TD>
<TD>"y1".."y99"</TD>
</TR>
<TR>
<TD>GR_PAR</TD>
<TD>"xt1".."xt99", "yt1".."yt99"</TD>
</TR>
<TR>
<TD>GR_POL</TD>
<TD>"r1".."r99"</TD>
</TR>
<TR>
<TD>GR_SEQ</TD>
<TD>"u1".."u99"</TD>
</TR>
<TR>
<TD>GR_3D</TD>
<TD>"z1".."z99"</TD>
</TR>
<TR>
<TD>GR_DE</TD>
<TD>"y'1".."y'99"</TD>
</TR>
<TR>
<TD>SEQ_INITC</TD>
<TD>"ui1".."ui99"</TD>
</TR>
<TR>
<TD>DE_INITC</TD>
<TD>"yi1".."yi99"</TD>
</TR>
<TR>
<TD>DR_FLDPIC</TD>
<TD>"FldPic"</TD>
</TR>
<TR>
<TD>SOLVER_SYS_VARS</TD>
<TD>"Exp", "Eqn"</TD>
</TR>
<TR>
<TD VALIGN="TOP">UNIT_VAR</TD>
<TD>name with a leading underscore</TD>
</TR>
<TR>
<TD>C_COL</TD>
<TD>"c1".."c99"</TD>
</TR>
<TR>
<TD>R_REGEQ</TD>
<TD>"RegEq"</TD>
</TR>
</TABLE>
<BR>
Note that <A HREF="#ExtendedSysTypes">ExtendedSysTypes</A> also
contains <A HREF="#ExtendedSysTypes">R_SYSVAR</A>, which may be
returned only by <A HREF="#CheckReservedName">CheckReservedName</A>.
In fact, this function cannot check for system variable names like "xmin".
<BR><BR>
Also, if <I>VarName</I> is a valid graph function name or column name
("y1", "c1", etc.), CheckSysFunc stores the function/column index at the word
pointed to by <I>Index</I>.</P>
<P>See also: <A HREF="#SymSysVar">SymSysVar</A>, <A HREF="#CheckReservedName">CheckReservedName</A></P>
<HR>
<H3><A NAME="ClearUserDef"><U>ClearUserDef</U></A></H3>
<P><TABLE BORDER="1" CELLPADDING="2"><TR><TD CLASS="CODE"><B><A HREF="keywords.html#void">void</A></B> ClearUserDef (<A HREF="alloc.html#HANDLE">HANDLE</A> hFuncVar);</TD></TR></TABLE></P>
<P><B>Clears TI-Basic program/function status flags.</B></P>
<P>This function assumes that <I>hFuncVar</I> is the handle of a TI-Basic program or
function variable (otherwise the behavior is unpredicted). It clears various
status flags which are embedded in the program or function variable itself,
which include the link lock flag (see
<A HREF="#CheckLinkLockFlag">CheckLinkLockFlag</A>), the entry counter
(which counts the depth of recursive calls of a function or program), and some
flags used in the "Graph" application.</P>
<HR>
<H3><A NAME="DataTypeNames"><U>DataTypeNames</U></A></H3>
<P><A HREF="httigcc.html#minams">AMS 2.00 or higher</A></P>
<P><TABLE BORDER="1" CELLPADDING="2"><TR><TD CLASS="CODE"><B><A HREF="keywords.html#short">unsigned</A></B> <B><A HREF="keywords.html#int">char</A></B> *DataTypeNames (<B><A HREF="keywords.html#short">unsigned</A></B> <B><A HREF="keywords.html#int">char</A></B>);</TD></TR></TABLE></P>
<P><B>Returns a pointer to a static string representing the type of the tag passed.</B></P>
<P>On AMS 2.xx, the string is localized for the current language; on AMS 1.xx, the string is in English, because no language localizations are available.<BR>
Valid values for <I>tag</I> are a subset of <A HREF="estack.html#Tags">Tags</A> and
<A HREF="estack.html#InstructionTags">InstructionTags</A>:</P>
<PRE>EXT_SYSTEM_TAG (0x1C)
STR_TAG (0x2D)
EQ_TAG (0x87)
DATA_TAG (0xDD)
GDB_TAG (0xDE)
PIC_TAG (0xDF)
TEXT_TAG (0xE0)
FIG_TAG (0xE1)
MAC_TAG (0xE2)
ASM_TAG (0xF3)
OTH_TAG (0xF8)
FUNC_ITAG (0x17)
PRGM_ITAG (0x19)
</PRE>
<P>If the tag is not allowed, the address of the string containing "?" is returned.</P>
<HR>
<H3><A NAME="DerefSym"><U>DerefSym</U></A></H3>
<P><TABLE BORDER="1" CELLPADDING="2"><TR><TD CLASS="CODE"><A HREF="#SYM_ENTRY">SYM_ENTRY</A> *DerefSym (<A HREF="#HSym">HSym</A> Sym);</TD></TR></TABLE></P>
<P><B>Dereferences a symbol.</B></P>
<P>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="#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="#SYM_ENTRY">SYM_ENTRY</A> pointers may become invalid after the heap compession.
<BR><BR>
DerefSym may be simulated using <A HREF="alloc.html#HeapDeref">HeapDeref</A>.
For example, the statement</P>
<PRE>SymPtr = DerefSym (hsym);
</PRE>
<P>is equal to the statement</P>
<PRE>SymPtr = (SYM_ENTRY*)((char*)HeapDeref(hsym.folder) + hsym.offset);
</PRE>
<P>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:</P>
<PRE>MainHandle = DerefSym(SymFindHome(SYMSTR("main")))->handle;
</PRE>
<P><B>Note:</B> <A HREF="#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.</P>
<HR>
<H3><A NAME="EM_moveSymFromExtMem"><U>EM_moveSymFromExtMem</U></A></H3>
<P><TABLE BORDER="1" CELLPADDING="2"><TR><TD CLASS="CODE"><B><A HREF="keywords.html#short">short</A></B> EM_moveSymFromExtMem (<A HREF="estack.html#SYM_STR">SYM_STR</A> SymName, <A HREF="#HSym">HSym</A> Sym);</TD></TR></TABLE></P>
<P><B>Moves a symbol from the archive memory to the RAM.</B></P>
<P>EM_moveSymFromExtMem unarchives an archived symbol. The symbol may be described either by
symbol name <I>SymName</I> (in this case, parameter <I>Sym</I> should be
set to <A HREF="#HS_NULL">HS_NULL</A>) or by <A HREF="#HSym">HSym</A> structure
<I>Sym</I> (in this case, <I>SymName</I> must be <A HREF="alloc.html#NULL">NULL</A>).
See <A HREF="#SYMSTR">SYMSTR</A> for rules about <I>SymName</I>.
EM_moveSymFromExtMem returns <A HREF="alloc.html#Bool">TRUE</A> if the operation was
successful, else returns <A HREF="alloc.html#Bool">FALSE</A>.</P>
<HR>
<H3><A NAME="EM_moveSymToExtMem"><U>EM_moveSymToExtMem</U></A></H3>
<P><TABLE BORDER="1" CELLPADDING="2"><TR><TD CLASS="CODE"><B><A HREF="keywords.html#short">short</A></B> EM_moveSymToExtMem (<A HREF="estack.html#SYM_STR">SYM_STR</A> SymName, <A HREF="#HSym">HSym</A> Sym);</TD></TR></TABLE></P>
<P><B>Moves a symbol from the RAM to the archive memory.</B></P>
<P>EM_moveSymToExtMem archives a symbol. The symbol may be described either by
symbol name <I>SymName</I> (in this case, parameter <I>Sym</I> should be
set to <A HREF="#HS_NULL">HS_NULL</A>) or by <A HREF="#HSym">HSym</A> structure
<I>Sym</I> (in this case, <I>SymName</I> must be <A HREF="alloc.html#NULL">NULL</A>).
See <A HREF="#SYMSTR">SYMSTR</A> for rules about <I>SymName</I>.
EM_moveSymToExtMem returns <A HREF="alloc.html#Bool">TRUE</A> if the operation was
successful, else returns <A HREF="alloc.html#Bool">FALSE</A>.</P>
<HR>
<H3><A NAME="EM_twinSymFromExtMem"><U>EM_twinSymFromExtMem</U></A></H3>
<P><TABLE BORDER="1" CELLPADDING="2"><TR><TD CLASS="CODE"><A HREF="#HSym">HSym</A> EM_twinSymFromExtMem (<A HREF="estack.html#SYM_STR">SYM_STR</A> SymName, <A HREF="#HSym">HSym</A> Sym);</TD></TR></TABLE></P>
<P><B>Creates a twin symbol, then copies a symbol from the archive memory to it.</B></P>
<P>EM_twinSymFromExtMem first calls <A HREF="#SymAddTwin">SymAddTwin</A> to create a twin
symbol, then copies the archived symbol to it. The symbol may be described either by
symbol name <I>SymName</I> (in this case, parameter <I>Sym</I> should be
set to <A HREF="#HS_NULL">HS_NULL</A>) or by <A HREF="#HSym">Hsym</A> structure
<I>Sym</I> (in this case, <I>SymName</I> must be <A HREF="alloc.html#NULL">NULL</A>).
See <A HREF="#SYMSTR">SYMSTR</A> for rules about <I>SymName</I>.
TIOS uses EM_twinSymFromExtMem when it need to execute archived program.
EM_twinSymFromExtMem returns a <A HREF="#HSym">HSym</A> structure which represents
a newly created symbol (or <A HREF="#HS_NULL">HS_NULL</A> in a case of error).
EM_twinSymFromExtMem returns <I>Sym</I> itself if the symbol is not archived.</P>
<HR>
<H3><A NAME="EX_stoBCD"><U>EX_stoBCD</U></A></H3>
<P><TABLE BORDER="1" CELLPADDING="2"><TR><TD CLASS="CODE"><B><A HREF="keywords.html#void">void</A></B> EX_stoBCD (<B><A HREF="keywords.html#short">unsigned</A></B> <B><A HREF="keywords.html#int">char</A></B> *VarName, <B><A HREF="keywords.html#float">float</A></B> *Src);</TD></TR></TABLE></P>
<P><B>Stores a floating point value into a variable.</B></P>
<P>EX_stoBCD stores the floating point value pointed to by <I>src</I> into the
TI-Basic variable whose name is pointed to by <I>VarName</I> (an ordinary C
string).</P>
<HR>
<H3><A NAME="FindProgramVar"><U>FindProgramVar</U></A></H3>
<P><TABLE BORDER="1" CELLPADDING="2"><TR><TD CLASS="CODE"><A HREF="#SYM_ENTRY">SYM_ENTRY</A> *FindProgramVar (<B><A HREF="keywords.html#void">void</A></B>);</TD></TR></TABLE></P>
<P><B>Finds the running program's variable.</B></P>
<P>FindProgramVar returns a pointer to the <A HREF="#SYM_ENTRY">SYM_ENTRY</A>
structure of the running program, or <A HREF="alloc.html#NULL">NULL</A>
in case it is not found (e.g. if the program was compressed).
<BR><BR>
<B>Note:</B> Do not call anything which may cause a heap compression between
when this function is called and when the pointer to it is used. Otherwise,
the pointer may become invalid, causing a crash or other random, unexpected
behavior. You can also use <A HREF="#FolderOp">FolderOp</A> to avoid
this problem.</P>
<HR>
<H3><A NAME="FindSymInFolder"><U>FindSymInFolder</U></A></H3>
<P><TABLE BORDER="1" CELLPADDING="2"><TR><TD CLASS="CODE"><A HREF="#HSym">HSym</A> FindSymInFolder (<A HREF="estack.html#SYM_STR">SYM_STR</A> SymName, <B><A HREF="keywords.html#const">const</A></B> <B><A HREF="keywords.html#int">char</A></B> *FolderName);</TD></TR></TABLE></P>
<P><B>Finds a symbol in a given folder.</B></P>
<P>FindSymInFolder acts like <A HREF="#SymFind">SymFind</A>, but searches for a symbol
in the folder given by <I>FolderName</I>. See <A HREF="#SYMSTR">SYMSTR</A>
for more info and rules about <I>SymName</I> and <I>FolderName</I>. As far
as I know, the statement</P>
<PRE>hsym = FindSymInFolder (SYMSTR ("tetris"), SYMSTR ("games"));
</PRE>
<P>acts exactly the same as the statement</P>
<PRE>hsym = SymFind (SYMSTR ("games\\tetris"));
</PRE>
<HR>
<H3><A NAME="FolderAdd"><U>FolderAdd</U></A></H3>
<P><TABLE BORDER="1" CELLPADDING="2"><TR><TD CLASS="CODE"><A HREF="alloc.html#HANDLE">HANDLE</A> FolderAdd (<A HREF="estack.html#SYM_STR">SYM_STR</A> SymName);</TD></TR></TABLE></P>
<P><B>Creates a folder.</B></P>
<P>FolderAdd creates a new folder with name <I>SymName</I>. See
<A HREF="#SYMSTR">SYMSTR</A> for rules about <I>SymName</I>. FolderAdd returns
a handle to the created folder (more precise, to the VAT variable list which belongs to
the created folder). Returns <A HREF="alloc.html#H_NULL">H_NULL</A> in a case of error (for example, the folder
already exists, or there is not enough memory). Note that reserved names are not valid folder names
and that this routine does not check for reserved names. It is up to the caller to validate
the folder name before calling this routine. This routine may cause heap compression.
<BR><BR>
This routine also can be used to create temporary folders
(see also <A HREF="#FolderAddTemp">FolderAddTemp</A>) whose names begin with a number and are not
displayed in VAR-LINK dialog. Temporary folder numbers '0001'...'8192' are reserved for
keeping TI-BASIC local symbols, folder number '9998' is used in Data/Matrix Editor,
and folder number '9999' is reserved for various temporary storage.</P>
<P>See also: <A HREF="#FolderAddTemp">FolderAddTemp</A>, <A HREF="#SymAdd">SymAdd</A></P>
<HR>
<H3><A NAME="FolderAddTemp"><U>FolderAddTemp</U></A></H3>
<P><TABLE BORDER="1" CELLPADDING="2"><TR><TD CLASS="CODE"><A HREF="estack.html#SYM_STR">SYM_STR</A> FolderAddTemp (<B><A HREF="keywords.html#void">void</A></B>);</TD></TR></TABLE></P>
<P><B>Creates a temporary folder.</B></P>
<P>FolderAddTemp creates a temporary folder whose name will consist of four digits
(see <A HREF="#TempFolderName">TempFolderName</A>). The first call of
FolderAddTemp will create a folder named "0001", the next call will create a
folder named "0002", etc.
FolderAddTemp returns the name of the created folder, with the same
convention as used in function
<A HREF="#TempFolderName">TempFolderName</A>. The created folder will
be marked as the "current temporary folder" (see
<A HREF="#FolderCurTemp">FolderCurTemp</A>). FolderAddTemp throws a
"Memory" error if there is not enough space for a new folder.</P>
<HR>
<H3><A NAME="FolderClear"><U>FolderClear</U></A></H3>
<P><TABLE BORDER="1" CELLPADDING="2"><TR><TD CLASS="CODE"><B><A HREF="keywords.html#short">short</A></B> FolderClear (<A HREF="estack.html#SYM_STR">SYM_STR</A> SymName);</TD></TR></TABLE></P>
<P><B>Deletes all files in the folder.</B></P>
<P>FolderClear deletes all files in the folder <I>SymName</I>, but does not remove the folder
itself. Returns <A HREF="alloc.html#Bool">TRUE</A> if the operation was successful,
else returns <A HREF="alloc.html#Bool">FALSE</A> (e.g. if the folder is not found). See <A HREF="#SYMSTR">SYMSTR</A> for rules
about <I>SymName</I>. Beware that this routine will delete all symbols in
the folder even if they are locked, in use, or archived!
<BR><BR>
<B>Note:</B> This function calls original TIOS entry called "FolderDel", but passes an
extra Boolean parameter set to <A HREF="alloc.html#Bool">TRUE</A>. See also note given with
<A HREF="#FolderDel">FolderDel</A> function.</P>
<P>See also: <A HREF="#FolderDel">FolderDel</A></P>
<HR>
<H3><A NAME="FolderCount"><U>FolderCount</U></A></H3>
<P><TABLE BORDER="1" CELLPADDING="2"><TR><TD CLASS="CODE"><B><A HREF="keywords.html#short">unsigned</A></B> <B><A HREF="keywords.html#short">short</A></B> FolderCount (<B><A HREF="keywords.html#const">const</A></B> <A HREF="#SYM_ENTRY">SYM_ENTRY</A> *SymPtr);</TD></TR></TABLE></P>
<P><B>Determines a number of symbols in a folder.</B></P>
<P>FolderCount returns the number of symbols in the folder whose VAT entry is
<I>SymPtr</I>. For example, to determine the number of symbols in the "main"
folder, do the following:</P>
<PRE>number = FolderCount (DerefSym (SymFindHome (SYMSTR ("main"))));
</PRE>
<P>See <A HREF="#SYMSTR">SYMSTR</A>, <A HREF="#SymFindHome">SymFindHome</A>, and
<A HREF="#DerefSym">DerefSym</A> for more info.</P>
<HR>
<H3><A NAME="FolderCur"><U>FolderCur</U></A></H3>
<P><TABLE BORDER="1" CELLPADDING="2"><TR><TD CLASS="CODE"><B><A HREF="keywords.html#short">short</A></B> FolderCur (<A HREF="estack.html#SYM_STR">SYM_STR</A> SymName, <B><A HREF="keywords.html#short">short</A></B> nonSys);</TD></TR></TABLE></P>
<P><B>Sets the currently active folder.</B></P>
<P>FolderCur sets the currently active folder to <I>SymName</I> (see
<A HREF="#SYMSTR">SYMSTR</A> for rules about <I>SymName</I>). It
returns <A HREF="alloc.html#Bool">TRUE</A> if the operation was
successful, else returns <A HREF="alloc.html#Bool">FALSE</A> (e.g. if
the folder name is invalid).
<BR><BR>
<I>nonSys</I> is a boolean flag which normally needs to be
<A HREF="alloc.html#Bool">TRUE</A>. If it is set to
<A HREF="alloc.html#Bool">TRUE</A>, FolderCur calls
<A HREF="#SymFindNext">SymFindNext</A> repeatedly until the
first non-system variable in this folder is reached. This is necessary, else
the current graph may become invalid. In particular, if the graph references
a variable defined in a folder which previously was the current folder, it is
not redrawn if <I>nonSys</I> is set to
<A HREF="alloc.html#Bool">FALSE</A>.
<BR><BR>
<B>Note:</B> The folder name in the status line will not be changed
automatically using this command. You must change it manually using the
function <A HREF="statline.html#ST_folder">ST_folder</A> from
<A HREF="statline.html">statline.h</A>.
<BR><BR>
This routine may cause heap compression.</P>
<P>See also: <A HREF="#FolderGetCur">FolderGetCur</A>, <A HREF="#FolderCurTemp">FolderCurTemp</A></P>
<HR>
<H3><A NAME="FolderCurTemp"><U>FolderCurTemp</U></A></H3>
<P><TABLE BORDER="1" CELLPADDING="2"><TR><TD CLASS="CODE"><B><A HREF="keywords.html#short">short</A></B> FolderCurTemp (<A HREF="estack.html#SYM_STR">SYM_STR</A> SymName);</TD></TR></TABLE></P>
<P><B>Sets the current temporary folder for storing local symbols.</B></P>
<P>FolderCurTemp sets the current temporary folder for storing local symbols to <I>SymName</I>.
<I>SymName</I> must be a "numeric" symbol name as functions like
<A HREF="#TempFolderName">TempFolderName</A> or <A HREF="#FolderAddTemp">FolderAddTemp</A>
returns. FolderCurTemp returns <A HREF="alloc.html#Bool">TRUE</A> if the operation was successful,
else returns <A HREF="alloc.html#Bool">FALSE</A>.</P>
<P>See also: <A HREF="#FolderCur">FolderCur</A></P>
<HR>
<H3><A NAME="FolderDel"><U>FolderDel</U></A></H3>
<P><TABLE BORDER="1" CELLPADDING="2"><TR><TD CLASS="CODE"><B><A HREF="keywords.html#short">short</A></B> FolderDel (<A HREF="estack.html#SYM_STR">SYM_STR</A> SymName);</TD></TR></TABLE></P>
<P><B>Deletes a folder, including all files in it.</B></P>
<P>FolderDel deletes the folder <I>SymName</I>
including all files in it, and returns <A HREF="alloc.html#Bool">TRUE</A> if the operation was successful,
else returns <A HREF="alloc.html#Bool">FALSE</A> (e.g. if the folder is not found). See <A HREF="#SYMSTR">SYMSTR</A> for rules
about <I>SymName</I>. If the folder <I>SymName</I> is the current folder, the new current
folder after deleting will become the "main" folder.
If the folder <I>SymName</I> is "main", then all symbols from it will be deleted,
but the folder itself will remain intact. Beware that this routine will delete all symbols in
the folder even if they are locked, in use, or archived!
<BR><BR>
<B>Note:</B> This function was buggy in TIGCCLIB releases prior to 2.3. I didn't know that the original
TIOS entry called "FolderDel" requires in fact two parameters: another one is a Boolean flag. As
this parameter was not passed before, the behaviour of this routine was random (see also
<A HREF="#FolderClear">FolderClear</A>). Now, to keep the compatibility with already written
programs, I modified FolderDel to always pass <A HREF="alloc.html#Bool">FALSE</A> as an extra parameter
(in this case, FolderDel behaves as described above; when it is <A HREF="alloc.html#Bool">TRUE</A>,
FolderDel behaves as <A HREF="#FolderClear">FolderClear</A>).</P>
<P>See also: <A HREF="#FolderClear">FolderClear</A></P>
<HR>
<H3><A NAME="FolderDelAllTemp"><U>FolderDelAllTemp</U></A></H3>
<P><TABLE BORDER="1" CELLPADDING="2"><TR><TD CLASS="CODE"><B><A HREF="keywords.html#void">void</A></B> FolderDelAllTemp (<B><A HREF="keywords.html#short">short</A></B> StartTempNum);</TD></TR></TABLE></P>
<P><B>Deletes a block of temporary folders.</B></P>
<P>FolderDelAllTemp deletes all temporary folders whose names are series of consequent
numbers starting from <I>StartTempNum</I> up to the first unused number, like in
following algorithm:</P>
<PRE>current=StartTempNum;<BR>
while (FolderFind ((name = TempFolderName (current++))) == 3)
FolderDel (name);
</PRE>
<P>The intention of this routine was very probably to delete all temporary folders when called
with <I>StartTempNum</I> equals to 1. But, there is a problem. This routine does not reset
the system variable which tells which is last used temporary folder number (I think that this
is a bug in TIOS). So, a next call of <A HREF="#FolderAddTemp">FolderAddTemp</A> will not start again
from folder named "0001". This may cause various problems later. That's why I strongly recommend
avoiding this routine, and using repeated call to <A HREF="#FolderDelTemp">FolderDelTemp</A>
instead.</P>
<HR>
<H3><A NAME="FolderDelTemp"><U>FolderDelTemp</U></A></H3>
<P><TABLE BORDER="1" CELLPADDING="2"><TR><TD CLASS="CODE"><B><A HREF="keywords.html#void">void</A></B> FolderDelTemp (<B><A HREF="keywords.html#void">void</A></B>);</TD></TR></TABLE></P>
<P><B>Deletes a temporary folder.</B></P>
<P>FolderDelTemp deletes the last created temporary folder and selects the previous temporary
folder as current temporary folder (see <A HREF="#FolderCurTemp">FolderCurTemp</A>). Nothing
bad will happen if the temporary folder does not exist, or in case of any eventual error.</P>
<HR>
<H3><A NAME="FolderFind"><U>FolderFind</U></A></H3>
<P><TABLE BORDER="1" CELLPADDING="2"><TR><TD CLASS="CODE"><B><A HREF="keywords.html#short">short</A></B> FolderFind (<A HREF="estack.html#SYM_STR">SYM_STR</A> SymName);</TD></TR></TABLE></P>
<P><B>Checks whether a folder exists.</B></P>
<P>FolderFind searches for a folder <I>SymName</I> through the folder table in the VAT,
and returns the following result:</P>
<UL>
<LI><P>MAIN_FOLDER, if <I>SymName</I> is the "main" folder;</P></LI>
<LI><P>FOLDER_TABLE, if a folder with name <I>SymName</I> exists;</P></LI>
<LI><P>NOT_FOUND, if a folder with name <I>SymName</I> does not exists;</P></LI>
<LI><P>BAD_FOLDER, if a symbol with name <I>SymName</I> is really present in the folder table,
but does not represents a folder (i.e. folder bit is not set); this return value
probably represents an invalid entry.</P></LI>
</UL>
<P>These constants are defined in enum <A HREF="#FolderStats">FolderStats</A>.
See <A HREF="#SYM_ENTRY">SYM_ENTRY</A> for more info about structure of VAT entry, and
<A HREF="#SYMSTR">SYMSTR</A> for rules about <I>SymName</I>.</P>
<HR>
<H3><A NAME="FolderGetCur"><U>FolderGetCur</U></A></H3>
<P><TABLE BORDER="1" CELLPADDING="2"><TR><TD CLASS="CODE"><B><A HREF="keywords.html#void">void</A></B> FolderGetCur (<B><A HREF="keywords.html#int">char</A></B> *buffer);</TD></TR></TABLE></P>
<P><B>Determines the current active folder.</B></P>
<P>FolderGetCur fills <I>buffer</I> with a name of the current active folder.
The buffer must be at least 9 bytes long, and it will be filled with a standard C
zero-terminated string.</P>
<P>See also: <A HREF="#FolderCur">FolderCur</A></P>
<HR>
<H3><A NAME="FolderOp"><U>FolderOp</U></A></H3>
<P><TABLE BORDER="1" CELLPADDING="2"><TR><TD CLASS="CODE"><B><A HREF="keywords.html#short">short</A></B> FolderOp (<A HREF="estack.html#SYM_STR">SYM_STR</A> SymName, <B><A HREF="keywords.html#short">short</A></B> Flags);</TD></TR></TABLE></P>
<P><B>Locks or unlocks a folder table.</B></P>
<P>FolderOp locks or unlocks a folder table which name is determined by <I>SymName</I>.
Returns <A HREF="alloc.html#Bool">TRUE</A> if the operation was successful, else returns <A HREF="alloc.html#Bool">FALSE</A>.
Parameter <I>Flags</I> may have following values (these constants are defined in
enum <A HREF="#FolderOpFlags">FolderOpFlags</A>):
<BR><BR>
<TABLE BORDER CELLPADDING="5">
<TR><TD VALIGN="TOP">FOP_UNLOCK</TD><TD>Unlocks a folder table</TD></TR>
<TR><TD VALIGN="TOP">FOP_LOCK</TD><TD>Locks a folder table</TD></TR>
<TR><TD VALIGN="TOP">FOP_ALL_FOLDERS</TD><TD>Locks/unlocks all folder tables (<I>SymName</I> is ignored);
this value should be ORed with one of FOP_UNLOCK or FOP_LOCK</TD></TR>
</TABLE>
<BR>
By locking the folder table, you may be sure that a dereferenced pointer to the table
will remain valid even after a lot of heap memory allocations (i.e. a garbage collection
will not move the table through memory).
<BR><BR>
<B>Note:</B> To lock the "home" folder (this is a pseudo-folder which contains all other folders in
itself, i.e. this is the table of folders), you need to know that its name consists only of the
character with code 0x7F (diamond). So, you can use</P>
<PRE>FolderOp (SYMSTR ("\x7F"), FOP_LOCK);
</PRE>
<P>to do this.</P>
<HR>
<H3><A NAME="FolderRename"><U>FolderRename</U></A></H3>
<P><TABLE BORDER="1" CELLPADDING="2"><TR><TD CLASS="CODE"><B><A HREF="keywords.html#short">short</A></B> FolderRename (<B><A HREF="keywords.html#const">const</A></B> <B><A HREF="keywords.html#int">char</A></B> *SrcName, <B><A HREF="keywords.html#const">const</A></B> <B><A HREF="keywords.html#int">char</A></B> *DestName);</TD></TR></TABLE></P>
<P><B>Renames a folder.</B></P>
<P>FolderRename renames the folder <I>SrcName</I> to the name <I>DestName</I>.
Returns <A HREF="alloc.html#Bool">TRUE</A> if the operation was successful
(<I>SrcName</I> must exist and must be a folder, and <I>DestName</I>
must not exist),
else returns <A HREF="alloc.html#Bool">FALSE</A>. See <A HREF="#SYMSTR">SYMSTR</A> for rules
about folder names. Note that this routine does not check for reserved names,
and may throw an error if renaming to or from a reserved name (e.g. "main"),
or if any variable in the given folder is in-use.</P>
<HR>
<H3><A NAME="GetDataType"><U>GetDataType</U></A></H3>
<P><A HREF="httigcc.html#minams">AMS 1.01 or higher</A></P>
<P><TABLE BORDER="1" CELLPADDING="2"><TR><TD CLASS="CODE"><B><A HREF="keywords.html#short">short</A></B> GetDataType (<A HREF="estack.html#CESI">CESI</A> tagptr);</TD></TR></TABLE></P>
<P><B>Returns the data type for a given tag pointed to by <I>tagptr</I>.</B></P>
<P>Valid values for the tag pointed to by <I>tagptr</I> are defined in the enum <A HREF="#SystemDataTypes">SystemDataTypes</A>.</P>
<P>See also: <A HREF="#SmapTypeStrings">SmapTypeStrings</A>, <A HREF="events.html#handleVarLinkKey">handleVarLinkKey</A></P>
<HR>
<H3><A NAME="GetFuncPrgmBodyPtr"><U>GetFuncPrgmBodyPtr</U></A></H3>
<P><TABLE BORDER="1" CELLPADDING="2"><TR><TD CLASS="CODE"><A HREF="estack.html#ESI">ESI</A> GetFuncPrgmBodyPtr (<A HREF="estack.html#ESI">ESI</A> ptr);</TD></TR></TABLE></P>
<P><B>Returns a pointer to a TI-Basic function/program body.</B></P>
<P>GetFuncPrgmBodyPtr returns the pointer to the function or program body of
the TI-Basic function or program pointed to by <I>ptr</I>. <I>ptr</I> must
point to the <A HREF="estack.html#FUNC_TAG">FUNC_TAG</A> quantum, i.e. to
the last byte of the variable. The parameters and flags are skipped.
See <A HREF="estack.html#Tags">Tags</A> for more
info on tags.</P>
<HR>
<H3><A NAME="GetTagStr"><U>GetTagStr</U></A></H3>
<P><A HREF="httigcc.html#minams">AMS 2.00 or higher</A></P>
<P><TABLE BORDER="1" CELLPADDING="2"><TR><TD CLASS="CODE"><B><A HREF="keywords.html#int">char</A></B> *GetTagStr (<A HREF="estack.html#ESI">ESI</A> tag, <B><A HREF="keywords.html#int">char</A></B> * buf);</TD></TR></TABLE></P>
<P><B>Returns the address of the string representing the special tag pointed to by <I>tag</I>.</B></P>
<P><I>tag</I> needs to point to one of EXT_SYSTEM_TAG (0x1C), EXT_TAG (0xE3) or EXT_INSTR_TAG (0xE4),
otherwise garbage is returned.<BR>
Also, if you pass GetTagStr a tag unrecognized by the AMS version, it returns a pointer to 'ERROR'.
<BR>
<BR>
<I><B>Example</B></I>: The TI-BASIC command ShowStat prints the string name for each statistical
variable it finds using GetTagStr to print the name of the variable as shown in this example.</P>
<PRE>
unsigned char tag[2];
char buf[24];
char buf2[11];
tag[0] = X_BAR_TAG; // in fact, any tag defined in <A HREF="estack.html#SysvarTags">SysvarTags</A>.
tag[1] = EXT_SYSTEM_TAG; // Defined in <A HREF="estack.html#Tags">Tags</A>
sprintf(buf,"%-7s",GetTagStr(tag+1,buf2));
</PRE>
<P>You can use <A HREF="estack.html#HToESI">HToESI</A> to get a pointer to the tag stored in <I>tag</I>.</P>
<HR>
<H3><A NAME="HSymDel"><U>HSymDel</U></A></H3>
<P><TABLE BORDER="1" CELLPADDING="2"><TR><TD CLASS="CODE"><B><A HREF="keywords.html#short">short</A></B> HSymDel (<A HREF="#HSym">HSym</A> Sym);</TD></TR></TABLE></P>
<P><B>Deletes a symbol pointed to by HSym.</B></P>
<P>HSymDel acts exactly like <A HREF="#SymDel">SymDel</A>, except it takes
a structure of type <A HREF="#HSym">HSym</A> as an input parameter instead of the symbol name
(see <A HREF="#SYMSTR">SYMSTR</A>).
<BR><BR>
<B>Note:</B> This routine assumes that <I>Sym</I> is valid; if it is not, it may throw
an error (for example, if <I>Sym</I> represents a reserved symbol like "main", or if the
referenced symbol is in-use). If HSymDel is called to delete a folder than that folder <I>must</I>
be empty! Also do not use HSymDel to delete twin or archived variables.
This routine modifies the VAT table, so it invalidates any other existing <A HREF="#HSym">HSym</A>s.
The caller must be sure that the VAT table has not been changed since <I>Sym</I>
was obtained.</P>
<P>See also: <A HREF="#SymFind">SymFind</A></P>
<HR>
<H3><A NAME="HSYMtoName"><U>HSYMtoName</U></A></H3>
<P><TABLE BORDER="1" CELLPADDING="2"><TR><TD CLASS="CODE"><B><A HREF="keywords.html#short">short</A></B> HSYMtoName (<A HREF="#HSym">HSym</A> Sym, <B><A HREF="keywords.html#int">char</A></B> *buffer);</TD></TR></TABLE></P>
<P><B>Determines a full path of a symbol.</B></P>
<P>HSYMtoName fills <I>buffer</I> with a full-path name (i.e. "folder\name")
of the symbol given by <A HREF="#HSym">HSym</A> structure <I>Sym</I>. See
<A HREF="#SYMSTR">SYMSTR</A> for more info about HSym names. The buffer must be
at least 18 bytes long, and it will be filled with a standard C zero-terminated string.
HSYMtoName returns <A HREF="alloc.html#Bool">TRUE</A> if the operation was successful,
else returns <A HREF="alloc.html#Bool">FALSE</A>.</P>
<HR>
<H3><A NAME="is_pathname"><U>is_pathname</U></A></H3>
<P><A HREF="httigcc.html#minams">AMS 1.01 or higher</A></P>
<P><TABLE BORDER="1" CELLPADDING="2"><TR><TD CLASS="CODE"><B><A HREF="keywords.html#short">short</A></B> is_pathname (<A HREF="estack.html#CESI">CESI</A> name);</TD></TR></TABLE></P>
<P><B>Checks if argument points to a pathname.</B></P>
<P><I>name</I> must be a valid <A HREF="estack.html#SYM_STR">SYM_STR</A> constructed with
<A HREF="#SYMSTR">SYMSTR</A> or equivalent.<BR>
This function first checks if <I>name</I> is pointing to the last byte of a SYM_STR (it must be
0x00), and searches backwards for character 0x5C ('\'). If is_pathname finds one such character,
it immediately retuns TRUE. If <I>name</I> doesn't point to a 0x00, or there is no '\' in the
string, it returns FALSE.<BR>
Note: this function is flawed, as it doesn't check if there is <I>only</I> one '\'. Indeed, a
string such as SYMSTR("main\foo\bar"), while it is a pathname (it contains '\'), is NOT a valid
pathname...</P>
<HR>
<H3><A NAME="IsMainFolderStr"><U>IsMainFolderStr</U></A></H3>
<P><TABLE BORDER="1" CELLPADDING="2"><TR><TD CLASS="CODE"><B><A HREF="keywords.html#short">short</A></B> IsMainFolderStr (<B><A HREF="keywords.html#const">const</A></B> <B><A HREF="keywords.html#int">char</A></B> *Name);</TD></TR></TABLE></P>
<P><B>Checks whether a name is the name of the main folder.</B></P>
<P>IsMainFolderStr returns <A HREF="alloc.html#Bool">TRUE</A> if <I>Name</I> is the string "main",
else returns <A HREF="alloc.html#Bool">FALSE</A>.</P>
<HR>
<H3><A NAME="MakeHSym"><U>MakeHSym</U></A></H3>
<P><TABLE BORDER="1" CELLPADDING="2"><TR><TD CLASS="CODE"><A HREF="#HSym">HSym</A> MakeHSym (<A HREF="alloc.html#HANDLE">HANDLE</A> FldHandle, <B><A HREF="keywords.html#const">const</A></B> <A HREF="#SYM_ENTRY">SYM_ENTRY</A> *SymPtr);</TD></TR></TABLE></P>
<P><B>Makes a HSym structure.</B></P>
<P>MakeHSym is an internal function, used very often in other TIOS routines. It converts the
VAT symbol entry pointed to by <I>SymPtr</I> which belongs to the folder associated with
handle <I>FldHandle</I> to the <A HREF="#HSym">HSym</A> structure. As HSym-s are basically a
combination of the folders handle and the offset of a symbol into that
folder, they are valid until a symbol is added or removed from the folder
they belong to. Dereferencing them with <A HREF="#DerefSym">DerefSym</A> produces a direct
pointer to the symbol entry, but such pointer are not valid after a heap compression is done.
The main usage of MakeHSym is when you need to preserve a pointer to the symbol entry after
a heap compression, like in following example:</P>
<PRE>hsym = MakeHsym (FldHandle, SymPtr);
// <I>Something that may cause heap compression...</I>
SymPtr = DerefSym (hsym);
</PRE>
<P>In this example, an eventual heap compression would cause the pointer to be invalid
since it is a direct pointer into memory. So the <I>SymPtr</I> is converted to a
<A HREF="#HSym">HSym</A> structure with MakeHsym (along with the handle of the folder that the
symbol belongs to). After the code that may cause heap compression is
executed, the HSym is converted back into a <A HREF="#SYM_ENTRY">SYM_ENTRY</A> pointer with
<A HREF="#DerefSym">DerefSym</A>.</P>
<P>Deprecated alias: MakeHsym</P>
<HR>
<H3><A NAME="partial_len"><U>partial_len</U></A></H3>
<P><TABLE BORDER="1" CELLPADDING="2"><TR><TD CLASS="CODE"><B><A HREF="keywords.html#short">unsigned</A></B> <B><A HREF="keywords.html#short">long</A></B> partial_len (<B><A HREF="keywords.html#const">const</A></B> <B><A HREF="keywords.html#int">char</A></B> *VarName, <B><A HREF="keywords.html#short">unsigned</A></B> <B><A HREF="keywords.html#int">char</A></B> *MaxList);</TD></TR></TABLE></P>
<P><B>Queries information about the Data Editor.</B></P>
<P>partial_len is used to query information about the temporary folder of the
Data Editor ("9998", see <A HREF="#FolderAdd">FolderAdd</A>), which
contains three variables for each column:
<BR><BR>
<TABLE BORDER CELLPADDING="3">
<TR>
<TD>"tc1".."tc99"</TD>
<TD>A STR variable containing the title for the column.</TD>
</TR>
<TR>
<TD>"hc1".."hc99"</TD>
<TD>An EXPR variable containing the formula for the column.</TD>
</TR>
<TR>
<TD>"c1".."c99"</TD>
<TD>A LIST variable containing the (fixed or calculated) cell values.</TD>
</TR>
</TABLE>
<BR>
<I>VarName</I> must be "tc", "hc", or "c", and partial_len returns the size
of all files matching <I>VarName</I>. It stores the last column which is used
into the byte pointed to by <I>MaxList</I>.</P>
<HR>
<H3><A NAME="QSysProtected"><U>QSysProtected</U></A></H3>
<P><TABLE BORDER="1" CELLPADDING="2"><TR><TD CLASS="CODE"><B><A HREF="keywords.html#short">short</A></B> QSysProtected (<A HREF="estack.html#ESQ">ESQ</A> Tag);</TD></TR></TABLE></P>
<P><B>Checks if a given tag represents a system-protected variable type.</B></P>
<P>QSysProtected returns <A HREF="alloc.html#Bool">TRUE</A> if the given
tag (see <A HREF="estack.html#Tags">Tags</A> for more info) is the tag
of a system protected data type, i.e. a
program/function (<A HREF="estack.html#FUNC_TAG">FUNC_TAG</A>),
assembly program (<A HREF="estack.html#ASM_TAG">ASM_TAG</A>),
text file (<A HREF="estack.html#TEXT_TAG">TEXT_TAG</A>),
graph database (<A HREF="estack.html#GDB_TAG">GDB_TAG</A>),
picture (<A HREF="estack.html#PIC_TAG">PIC_TAG</A>),
data variable (<A HREF="estack.html#DATA_TAG">DATA_TAG</A>), or
custom file (<A HREF="estack.html#OTH_TAG">OTH_TAG</A>).
Otherwise, QSysProtected returns <A HREF="alloc.html#Bool">FALSE</A>.</P>
<P>See also: <A HREF="#VarStore">VarStore</A></P>
<HR>
<H3><A NAME="ResetSymFlags"><U>ResetSymFlags</U></A></H3>
<P><TABLE BORDER="1" CELLPADDING="2"><TR><TD CLASS="CODE"><B><A HREF="keywords.html#void">void</A></B> ResetSymFlags (<B><A HREF="keywords.html#short">unsigned</A></B> <B><A HREF="keywords.html#short">short</A></B> Flags);</TD></TR></TABLE></P>
<P><B>Clears all VAT symbols flags.</B></P>
<P>Clears all VAT symbol flags (i.e. flags defined in the enum
<A HREF="#SymFlags">SymFlags</A>) which
are set in the <I>Flags</I> parameter, for all entries in the VAT table
(i.e. in all folders).</P>
<HR>
<H3><A NAME="SetOK"><U>SetOK</U></A></H3>
<P><TABLE BORDER="1" CELLPADDING="2"><TR><TD CLASS="CODE"><B><A HREF="keywords.html#void">void</A></B> SetOK (<B><A HREF="keywords.html#short">short</A></B> value);</TD></TR></TABLE></P>
<P><B>Changes the system variable <CODE>'OK'</CODE>.</B></P>
<P>If <I>value</I> is <A HREF="alloc.html#Bool">TRUE</A>, <CODE>'OK'</CODE> is set to 1;
if it is <A HREF="alloc.html#Bool">FALSE</A>, <CODE>'OK'</CODE> is set to 0.</P>
<HR>
<H3><A NAME="SmapTypeStrings"><U>SmapTypeStrings</U></A></H3>
<P><A HREF="httigcc.html#minams">AMS 2.00 or higher</A></P>
<P><TABLE BORDER="1" CELLPADDING="2"><TR><TD CLASS="CODE"><B><A HREF="keywords.html#const">const</A></B> <B><A HREF="keywords.html#int">char</A></B> *SmapTypeStrings (<B><A HREF="keywords.html#short">short</A></B> type);</TD></TR></TABLE></P>
<P><B>Returns the 3-4 character description of a variable type.</B></P>
<P>SmapTypeStrings returns a string of three characters for the variable type
represented by <I>type</I>. Valid values for <I>type</I> are defined in the
enum <A HREF="#SystemDataTypes">SystemDataTypes</A>; you can use
<A HREF="#GetDataType">GetDataType</A> to convert a tag to such a
type value.<BR>
<CODE>NULL</CODE> is returned if <I>type</I> is incorrect.
<BR><BR>
The value returned is the string displayed in the VAR-LINK dialog. This
string is localized for the current language and can be up to four characters
long. Note that files of type <A HREF="#SystemDataTypes">SDT_OTH</A> will
return a pointer to the string "OTH", and not to the true extension of the
file.</P>
<P>See also: <A HREF="#GetDataType">GetDataType</A>, <A HREF="events.html#handleVarLinkKey">handleVarLinkKey</A></P>
<HR>
<H3><A NAME="StrToTokN"><U>StrToTokN</U></A></H3>
<P><TABLE BORDER="1" CELLPADDING="2"><TR><TD CLASS="CODE"><A HREF="estack.html#ESI">ESI</A> StrToTokN (<B><A HREF="keywords.html#const">const</A></B> <B><A HREF="keywords.html#int">char</A></B> *src, <B><A HREF="keywords.html#short">unsigned</A></B> <B><A HREF="keywords.html#int">char</A></B> *dest);</TD></TR></TABLE></P>
<P><B>Converts a C string to a token.</B></P>
<P>StrToTokN converts a symbol name pointed to by <I>src</I>, which is an ordinary ANSI C string,
into a tokenized symbol name. See <A HREF="#SYMSTR">SYMSTR</A> for more info about symbol names.
<I>dest</I> must point to a buffer of 20 bytes (which is the maximum length of
the expanded file name). The tokenized name is stored there starting at the
end of the buffer. StrToTokN returns a pointer to the terminating zero byte of the
converted name, exactly as expected in most routines from vat.h.
<BR><BR>
<B>Note:</B> This routine merely converts a name into tokenized format; it does not
handle reserved names or check for the validity of the name passed to it.
For this reason, <A HREF="estack.html#TokenizeSymName">TokenizeSymName</A> should
be used in general to tokenize symbol names.</P>
<P>See also: <A HREF="#TokToStrN">TokToStrN</A>, <A HREF="#SYMSTR">SYMSTR</A></P>
<HR>
<H3><A NAME="SymAdd"><U>SymAdd</U></A></H3>
<P><TABLE BORDER="1" CELLPADDING="2"><TR><TD CLASS="CODE"><A HREF="#HSym">HSym</A> SymAdd (<A HREF="estack.html#SYM_STR">SYM_STR</A> SymName);</TD></TR></TABLE></P>
<P><B>Adds a symbol.</B></P>
<P>SymAdd creates a new entry in the variable allocation table (VAT) for a symbol called
<I>SymName</I>, and returns the same type of result as the <A HREF="#SymFind">SymFind</A>
function. If the symbol <I>SymName</I> already exists, SymAdd deletes the old
symbol before creating a new one (except if <I>SymName</I> is a folder name;
this case is considered an error). In case of an error, SymAdd returns <A HREF="#HS_NULL">HS_NULL</A>.
This function may throw an error if the symbol already exists and it is locked.
See <A HREF="#SymFind">SymFind</A> and <A HREF="#DerefSym">DerefSym</A> for more info.
<BR><BR>
<I>SymName</I> may also contain a folder name together with the symbol name
(separated by "\"). In this case, the symbol will be added in the given folder.
If the given folder does not exist, a dialog will appear which asks the user whether
a new folder will be created. If the answer is "NO", a "Folder" error will be thrown
(beware that opening a dialog may change the system font, so the use of
<A HREF="graph.html#SaveScrState">SaveScrState</A> and <A HREF="graph.html#RestoreScrState">RestoreScrState</A>
is highly recommended in all cases when you expect that a folder creation dialog might appear).
If <I>SymName</I> does not contain a folder name, the symbol entry will be created
in the current active folder. This routine does not check for reserved symbol names,
so caution must be used when using this routine.
<BR><BR>
Note that SymAdd adds only an entry in the VAT with an empty handle; it does not allocate
any space for the actual variable. To actually create a variable named "example", do
the following (assuming that there were no errors in intermediate steps):</P>
<PRE>HSym hsym = SymAdd (SYMSTR ("example"));
// HeapAlloc must be executed before DerefSym
// because of possible garbage collection.
HANDLE handle = HeapAlloc (100);
SYM_ENTRY *SymPtr = (DerefSym (hsym));
MULTI_EXPR *VarPtr = HeapDeref (SymPtr->handle = handle);
</PRE>
<P>Now, 100 bytes of space for the variable (together with the valid handle in the VAT entry) is
created, and <I>VarPtr</I> points to it (see <A HREF="alloc.html#HeapAlloc">HeapAlloc</A> and
<A HREF="alloc.html#HeapDeref">HeapDeref</A> for more info). It does not mean that the actual
length of the variable must be 100 bytes: it is only the allocated amount of memory.
To create a concrete
variable, you must fill the space pointed to by <I>VarPtr</I> with valid data which depends on
the wanted type of the variable. The format of some variable types (STR, PIC, TEXT etc.) may
be found on <A HREF="http://doors.ticalc.org">doors.ticalc.org</A>. For example, to create a
one-character long string variable with content "A", do the following:</P>
<PRE>VarPtr->Size = 4; // <I>length of the variable data</I>
VarPtr->Expr[0] = 0; // <I>zero marks the beginning of the actual variable data</I>
VarPtr->Expr[1] = 'A'; // <I>actual data</I>
VarPtr->Expr[2] = 0; // <I>end-of-string marker</I>
VarPtr->Expr[3] = STR_TAG; // <I>the last byte is the type (see <A HREF="estack.html#STR_TAG">STR_TAG</A>)</I>
</PRE>
<P><B>Note:</B> It is very dangerous to add a new entry in the VAT without allocating a memory
space, and without assigning the handle in the entry. I didn't check whether a real
TI-89 crashes after this, but the debugger in VTI crashes!? Rusty, this is a bug...</P>
<P>See also: <A HREF="#SymAddMain">SymAddMain</A>, <A HREF="#FolderAdd">FolderAdd</A>, <A HREF="estack.html#MULTI_EXPR">MULTI_EXPR</A></P>
<HR>
<H3><A NAME="SymAddMain"><U>SymAddMain</U></A></H3>
<P><TABLE BORDER="1" CELLPADDING="2"><TR><TD CLASS="CODE"><A HREF="#HSym">HSym</A> SymAddMain (<A HREF="estack.html#SYM_STR">SYM_STR</A> SymName);</TD></TR></TABLE></P>
<P><B>Adds a symbol in the main folder.</B></P>
<P>SymAddMain acts like <A HREF="#SymAdd">SymAdd</A>, but adds the VAT entry in the main
folder list, regardless of the current active folder, even if <I>SymName</I> contains
the folder name together with the symbol name. See <A HREF="#SymAdd">SymAdd</A>
for more info.</P>
<P>See also: <A HREF="#SymAdd">SymAdd</A></P>
<HR>
<H3><A NAME="SymAddTwin"><U>SymAddTwin</U></A></H3>
<P><TABLE BORDER="1" CELLPADDING="2"><TR><TD CLASS="CODE"><A HREF="#HSym">HSym</A> SymAddTwin (<A HREF="estack.html#SYM_STR">SYM_STR</A> SymName);</TD></TR></TABLE></P>
<P><B>Creates a twin symbol.</B></P>
<P>SymAddTwin creates a twin entry in the variable allocation table (VAT) for an
existing symbol <I>SymName</I>. A twin symbol is, in fact, another entry in the VAT
with the same variable name, but with a different handle. The TIOS creates twin symbols
during execution of archived programs, just in front of the normal symbol in the VAT table
(see <A HREF="#EM_twinSymFromExtMem">EM_twinSymFromExtMem</A>).
A twin symbol is "stronger" that a normal symbol, i.e. existence of a twin symbol temporary hides the symbol with the same
name, until the twin symbol is deleted. Twin symbols have the "twin" bit set in the VAT
entry (see <A HREF="#SYM_ENTRY">SYM_ENTRY</A> for the structure of a VAT entry), but in
the VAR-LINK menu, it is shown as "archived". SymAddTwin returns the same result as
<A HREF="#SymAdd">SymAdd</A> (<A HREF="#HS_NULL">HS_NULL</A> in case of an error). If the symbol <I>SymName</I>
does not exist, this is also an error.</P>
<HR>
<H3><A NAME="SymCmp"><U>SymCmp</U></A></H3>
<P><TABLE BORDER="1" CELLPADDING="2"><TR><TD CLASS="CODE"><B><A HREF="keywords.html#short">short</A></B> SymCmp (<B><A HREF="keywords.html#const">const</A></B> <B><A HREF="keywords.html#int">char</A></B> *s1, <B><A HREF="keywords.html#const">const</A></B> <B><A HREF="keywords.html#int">char</A></B> *s2);</TD></TR></TABLE></P>
<P><B>Compares two symbol names.</B></P>
<P>SymCmp compares two symbol names by comparing at most 8 characters starting from
addresses pointed to by <I>s1</I> and <I>s2</I>. It returns the same result as
<A HREF="string.html#strcmp">strcmp</A>. It seems that calling this function is equal to</P>
<PRE>strncmp (s1, s2, 8);
</PRE>
<P>See <A HREF="string.html#strncmp">strncmp</A> for more info.</P>
<HR>
<H3><A NAME="SymCpy0"><U>SymCpy0</U></A></H3>
<P><TABLE BORDER="1" CELLPADDING="2"><TR><TD CLASS="CODE"><B><A HREF="keywords.html#void">void</A></B> SymCpy0 (<B><A HREF="keywords.html#int">char</A></B> *dest, <B><A HREF="keywords.html#const">const</A></B> <B><A HREF="keywords.html#int">char</A></B> *src);</TD></TR></TABLE></P>
<P><B>Copies a symbol name with putting zero byte at the end.</B></P>
<P>SymCpy0 first performs <A HREF="#SymCpy">SymCpy</A>, then puts the zero byte in
ninth byte of the string pointed to by <I>dest</I> (i.e. in <I>dest</I>[8]). So,
<I>dest</I> must be at least 9 bytes long.</P>
<HR>
<H3><A NAME="SymCpy"><U>SymCpy</U></A></H3>
<P><TABLE BORDER="1" CELLPADDING="2"><TR><TD CLASS="CODE"><B><A HREF="keywords.html#void">void</A></B> SymCpy (<B><A HREF="keywords.html#int">char</A></B> *dest, <B><A HREF="keywords.html#const">const</A></B> <B><A HREF="keywords.html#int">char</A></B> *src);</TD></TR></TABLE></P>
<P><B>Copies a symbol name.</B></P>
<P>SymCpy copies at most 8 characters from string <I>src</I> to <I>dest</I>, then fills
rest of the <I>dest</I> up to 8 bytes, so <I>dest</I> must be at least 8 bytes
long. It seems that calling this function is equal to</P>
<PRE>strncpy (dest, src, 8);
</PRE>
<P>except in the fact that function SymCpy is void.
See <A HREF="string.html#strncpy">strncpy</A> for more info.</P>
<HR>
<H3><A NAME="SymDel"><U>SymDel</U></A></H3>
<P><TABLE BORDER="1" CELLPADDING="2"><TR><TD CLASS="CODE"><B><A HREF="keywords.html#short">short</A></B> SymDel (<A HREF="estack.html#SYM_STR">SYM_STR</A> SymName);</TD></TR></TABLE></P>
<P><B>Deletes a symbol.</B></P>
<P>SymDel deletes the symbol <I>SymName</I> and returns <A HREF="alloc.html#Bool">TRUE</A> if the operation was successful,
else returns <A HREF="alloc.html#Bool">FALSE</A>. See <A HREF="#SYMSTR">SYMSTR</A> for rules
about <I>SymName</I>. Note that this routine will delete symbols even if they are locked or
in use! Do not call SymDel to delete a folder, or twin or archived symbols (for these purposes,
see <A HREF="#FolderDel">FolderDel</A> and <A HREF="#SymDelTwin">SymDelTwin</A>).
<BR><BR>
<B>Note:</B> Do not call SymDel to delete twin symbols. Instead, use the
<A HREF="#SymDelTwin">SymDelTwin</A> function.</P>
<HR>
<H3><A NAME="SymDelTwin"><U>SymDelTwin</U></A></H3>
<P><TABLE BORDER="1" CELLPADDING="2"><TR><TD CLASS="CODE"><B><A HREF="keywords.html#short">short</A></B> SymDelTwin (<A HREF="#SYM_ENTRY">SYM_ENTRY</A> *SymPtr);</TD></TR></TABLE></P>
<P><B>Deletes a twin symbol.</B></P>
<P>SymDelTwin deletes a twin symbol (see <A HREF="#SymAddTwin">SymAddTwin</A> for more info
about twin symbols) whose VAT entry is <I>SymPtr</I>. Returns <A HREF="alloc.html#Bool">TRUE</A> if
the operation was successful, else returns <A HREF="alloc.html#Bool">FALSE</A>.
<BR><BR>
When the TIOS deletes a twin symbol, the current value of the flags
<A HREF="#SymFlags">SF_GREF1</A>, <A HREF="#SymFlags">SF_GREF2</A>,
and <A HREF="#SymFlags">SF_STATVAR</A>
are copied from the twin symbol to the original symbol.
<BR><BR>
<B>Note:</B> Since the TIOS is not able to get the folder handle with only the
<A HREF="#SYM_ENTRY">SYM_ENTRY</A> structure, it reads
the folder address, the number of files in this folder, and the maximum
number of files in the folder from the global variables used by
<A HREF="#SymFindFirst">SymFindFirst</A> and related functions.
If the program changes these variables (for example by simply using
<A HREF="#SymFindFirst">SymFindFirst</A>) or if it adds or deletes a
symbol in the VAT by itself without using <A HREF="#SymAdd">SymAdd</A>
and <A HREF="#SymDel">SymDel</A>, SymDelTwin will cause severe data
corruption.
<BR><BR>
The solution is simple: Always call <A HREF="#SymFindPtr">SymFindPtr</A>
with the complete name of the twin symbol before calling SymDelTwin; passing