HyperMath

HyperMath to EvalFile

HyperMath to EvalFile

Previous topic Next topic Expand/collapse all hidden text  

HyperMath to EvalFile

Previous topic Next topic JavaScript is required for expanding text JavaScript is required for the print function  
hmtoggle_plus1greyEvalTclFile(filename)

Evaluates a Tcl file.  Any error reported by Tcl is retuned as a string.  Returns 1 on success.

filename

A fully qualified Tcl filename.  Folder must be separated by forward slash, (/), or (\\).

hmtoggle_plus1greyEvalTclScript(command)

Evaluates Tcl commands.  Any error reported by Tcl is retuned as a string.  Returns 1 on success.

command

Any valid Tcl command as a string.

hmtoggle_plus1greyExportToTcl(hml_var, tcl_var)

Exports HyperMath variable content to Tcl.  Supported variables types are numbers, vectors and strings.  Any error reported by Tcl is retuned as a string.  Returns 1 on success.

hml_var        

The HyperMath variable name.

tcl_var        

The assigned Tcl variable in quotes.

hmtoggle_plus1greyhml_var = GetTclArray(tcl_var)

Imports Tcl global array content to a HyperMath table.  Supported variables types are 1-D arrays.

tcl_var

The Tcl array name in quotes.

hml_var        

The assigned HyperMath variable name. It is of the type "table".

hmtoggle_plus1greyhml_var = GetTclNumArray(tcl_var)

Imports a Tcl global numeric array content to a HyperMath vector.  Supported variables types are 1-D numeric arrays.

tcl_var

The Tcl numeric array name in quotes.

hml_var        

The assigned HyperMath variable name.  It is a vector.

Example

EvalTclScript("set a 20"); // This will evaluate the Tcl command

EvalTclFile("C:/file.tcl"); // This will evaluate the Tcl file

a=10

ExportToTcl(a,'::b'); // exports the scalar content to a Tcl variable 'b'

b = GetTclVar('::b'); // extracts the variable back into HyperMath

a=[10, 20];

ExportToTcl(a,'::c'); // exports the array content to a Tcl variable 'c'

c= GetTclArray('::c'); // extracts the array back into a HyperMath table

v= GetTclNumArray('::c'); // extracts the array back into a HyperMath vector

hmtoggle_plus1greyhml_var = GetTclVar(tcl_var, index)

Imports a Tcl global variable content to HyperMath.  Supported variables types are numbers and strings.

tcl_var

The Tcl variable name in quotes.

index

The index if the above variable is a Tcl array.

hml_var

The assigned HyperMath variable name.

NoteWhile working in HyperMath, the outputs from any Tcl command can be viewed in the Tcl command window.  Also, the debugger will be able to switch between HyperMath and Tcl files.