Home Cooker Classes Others Rice
Classes  >  jsexecutor  >  Execute(string)
jsexecutor class : Execute(string) method

Description

Executes JavaScript code passed by the argument.

Syntax

jsexecutorInstance.Execute(string jsCode)

Arguments

ClassNameDescription
stringjsCodeJavaScript code.

Return value

ClassDescription
real,string, or boolA return value from the JavaScript code.

Sample code

1:

jsexecutor jse = new jsexecutor();

2:

string jsCode = "return 100;";

3:

real result = jse.Execute(jsCode); // The result is 100.

Notes

If the return value from the JavaScript function is a number, the return class will be real class.

If the return value from the JavaScript function is a string, the return class is string class.

If the return value from the JavaScript function is a boolean, the return class will be bool class.

Otherwise, the return class will be void class.

Links for reference

None.

Copyright © Rice All rights reserved.