Download the PDF documentation - True BASIC
Download the PDF documentation - True BASIC
Download the PDF documentation - True BASIC
You also want an ePaper? Increase the reach of your titles
YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.
33<br />
<strong>True</strong> <strong>BASIC</strong> Language System<br />
Example: The following program:<br />
LIBRARY "StrLib.trc"<br />
DECLARE DEF ShortDate$<br />
PRINT ShortDate$("19971015")<br />
END<br />
produces <strong>the</strong> following output:<br />
15 Oct 97<br />
Exceptions: 1 Bad date given to ShortDate$: 00000000<br />
See also: DATE$, DATE, SHORTDATE$, WEEKDAY$, WEEKDAY, TODAY$, TIME, TIME$,<br />
NICETIME$, NOW$<br />
SUPERVAL Subroutine<br />
Library:<br />
Syntax:<br />
strarrarg::<br />
Usage:<br />
Summary:<br />
Details:<br />
STRLIB.TRC<br />
CALL SUPERVAL (strarrarg, strex, numvar)<br />
strarr<br />
strarr bowlegs<br />
CALL SUPERVAL (table$(), expression$, result)<br />
Evaluates <strong>the</strong> expression represented by <strong>the</strong> contents of expression$ and returns <strong>the</strong><br />
resulting value in result.<br />
The SUPERVAL subroutine evaluates <strong>the</strong> numeric expression represented by <strong>the</strong> value of<br />
expression$ and returns <strong>the</strong> resulting value in result.<br />
The value of expression$ must represent a numeric expression which is valid under <strong>the</strong><br />
rules of <strong>True</strong> <strong>BASIC</strong>. This expression may contain both numeric constants and variables.<br />
You can use expressions like “a = 2” or “length, width, height = 1” to create variables and set<br />
<strong>the</strong>ir values.<br />
Like <strong>the</strong> numeric constants, <strong>the</strong> variables used in expression$ must follow <strong>True</strong> <strong>BASIC</strong>’s<br />
rules for <strong>the</strong> formation of variable names. These variables are not connected with <strong>the</strong> variables<br />
used in your program code; <strong>the</strong>y form <strong>the</strong>ir own variable pool which is created and used<br />
exclusively by <strong>the</strong> SUPERVAL subroutine.<br />
The SUPERVAL subroutine uses <strong>the</strong> table$ array to manage this pool of variables. You<br />
don’t need to worry about maintaining <strong>the</strong> table$ array; just pass any one-dimensional<br />
array as table$, and <strong>the</strong> SUPERVAL subroutine will do <strong>the</strong> rest. However, since <strong>the</strong><br />
table$ array is used to store <strong>the</strong> variable pool, you should be sure to pass <strong>the</strong> same table$<br />
array to each invocation of <strong>the</strong> SUPERVAL subroutine which you would like to have access<br />
to <strong>the</strong> variables in that pool.<br />
The value of expression$ may incorporate any of <strong>the</strong> following operators:<br />
Operators Available to SUPERVAL<br />
+ - * / ^ ( )<br />
In addition, <strong>the</strong> value of expression$ may incorporate any of <strong>the</strong> following numeric functions:<br />
Functions Available to SUPERVAL<br />
SIN COS TAN ATN SQR<br />
SINH COSH TANH ASIN ACOS<br />
SEC CSC COT MAXNUM EPS<br />
PI SGN ABS RAD DEG<br />
LOG LOG2 LOG10 EXP RND<br />
INT ROUND IP FP CEIL<br />
DATE<br />
TIME<br />
Note that numeric functions requiring two arguments, including <strong>the</strong> two-argument form of<br />
<strong>the</strong> ROUND function, are not available for use in <strong>the</strong> value of expression$.