[Main]
Title=Returning Values Through Variables

[Top]
As mentioned in the previous section, returning a value from ASM program on a similar
way like TI-Basic functions return values causes problems with AMS 2.xx. So, in this
release of TIGCCLIB, another way for returning values (which works well unconditionally)
is introduced. This method will be ilustrated using a concrete example. Look the following
modified "Folder" program given in the previous section (called "Folder List"):
$$EXAMPLE(Folder List.c)
The only difference between this program and the program in the previous section is in
the usage of the <CODE>RETURN_VALUE</CODE> directive: in this example, it is followed
with a variable name (<CODE>dirlist</CODE> in this example). If
<CODE>RETURN_VALUE</CODE> is followed with a variable name (which must be a legal
TI-Basic variable name in lowercase), the last value pushed to the expression stack would
be stored in the TI-Basic variable with the given name. So, in this example, after execution
of the program, the result of the program (a folder list) will be stored in TI-Basic
variable called <CODE>dirlist</CODE> (if such variable does not exist, it will be
created). See the <A HREF="$$LINK(retval)">previous section</A> for more info about this example. I hope that this
explanation is clear enough, so more detailed explanation is not necessary.
