Raphael Collet wrote:

Alan Oswald wrote:

The GetText function uses get($) as a text string. How do I get it as a number?


Convert it: {String.toInt "42"} returns 42.

raph

A more powerful way is to compile it:

  I={Compiler.evalExpression "42" env _}

This compiles the string as if you typed it as source code, and then evaluates
the expression.  The general calling sequence is:

  E={Compiler.evalExpression Expr Env KP}

where Expr is a string, Env is an environment (a record whose fields give values to the free identifiers in Expr, e.g., env('Sin':Sin) if you use the sine function Sin in Expr), and KP is a kill procedure (a nullary procedure that you can call to stop a compilation that is taking too long). See the documentation of the Compiler module for more
information!

Peter



_________________________________________________________________________________
mozart-users mailing list                               
[email protected]
http://www.mozart-oz.org/mailman/listinfo/mozart-users

Reply via email to