07.05.2015 Views

Download - True BASIC

Download - True BASIC

Download - True BASIC

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

428 <strong>True</strong> <strong>BASIC</strong> Language System<br />

Example:<br />

One Million<br />

and passing a value of 1000000000 results in a return value of:<br />

One Billion<br />

Note that the results of the ENGLISHNUM$ function can be wrong for very large numbers<br />

(usually those greater than 9,000,000,000) because of the inaccuracy introduced by floating<br />

point round off errors.<br />

The following program:<br />

LIBRARY “STRLIB.TRC”<br />

DECLARE DEF EnglishNum$<br />

Exceptions:<br />

See also:<br />

EVAL Function<br />

Library:<br />

Syntax:<br />

Usage:<br />

Summary:<br />

Details:<br />

FOR i = 1 to 10<br />

FOR j = 1 to 10<br />

PRINT EnglishNum$(i); “ times “; EnglishNum$(j);<br />

PRINT “ is “; EnglishNum$(i*j)<br />

NEXT j<br />

NEXT i<br />

GET KEY k<br />

END<br />

produces a multiplication table in English (that is, without using digits).<br />

None<br />

ROMAN$<br />

STRLIB.TRC<br />

EVAL (strex)<br />

LET result = EVAL (expression$)<br />

Returns the value of the constant-based expression represented by the contents of its string<br />

argument.<br />

The EVAL function evaluates the numeric expression represented by the value of<br />

expression$ and returns the resulting value.<br />

The value of expression$ must represent a numeric expression which is valid under the<br />

rules of <strong>True</strong> <strong>BASIC</strong>. This expression may contain numeric constants, but not variables.<br />

(For the evaluation of expressions containing variables, see the SUPERVAL subroutine.)<br />

The value of expression$ may incorporate any of the following operators:<br />

Operators Available to EVAL<br />

+ - * / ^ ( )<br />

In addition, the value of expression$ may incorporate any of the following numeric<br />

functions:<br />

Functions Available to EVAL<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 the two-argument form of<br />

the ROUND function, are not available for use in the value of expression$.<br />

Also note that the EVAL function is not as fast as the VAL function, but it is a great deal<br />

more flexible.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!