Evaluate$

<< Click to Display Table of Contents >>

Navigation:  ThinBASIC Core Language > BuiltIn Functions > String functions >

Evaluate$

 

Description

 

Evaluate a string expression to be interpreted at run-time as a thinBasic string expression.

 

Syntax

 

s = Evaluate$(StringExpresion [, ActivateRuntimeErrors])

 

Returns

 

String

 

Parameters

 

Name

Type

Optional

Meaning

StringExpresion

String

No

Text containing a valid thinBasic string expression to be evaluated at run-time

ActivateRuntimeErrors

Number

Yes

By default $() will ignore run-time errors while interpreting interpolated expressions.

 

Setting this optional parameter to %TRUE will generate a parsing error if one interpolated expression will generate e run-time error.

 

Remarks

 

Restrictions

 

String expression must be a valid thinBasic expression in the running context and scope.

It can refer to local or global variables.

It can contains string and numeric expressions

It can contains any valid module functions active in current script.

 

See also

 

Evaluate, $,

 

Examples

 

 

uses "console"
 
long X = 2
long Y = 3
 
printl "Value is: " + Evaluate$("Sqr(X * X + Y * Y)")
 
WaitKey
 
 
'-----------------------------------------------------------------------------------
PrintL
dim lDate as new CDATETIME
 
printl "Date is: " + Evaluate$("ldate.DateStringLong")
 
WaitKey