Execute a cScript.
Execute a cScript.
Name | Type | Default | Description |
Return | int | 0 or Error Code | |
actionID | int | - | ID of a defined action of the current data connection 0 : Use script path path |
path | String oder char* | - | Full path to a script file. |
... | Triples each consisting of int, String or char* and a value | - | FFunction parameters, each consisting of the data type, the variable name in the script and the (type-dependent) value.
The following data types with the corresponding values are permitted: Input parameters 1 - kInt : Integer or integer variable, e.g.: kInt, "myint", 12 kInt, "myint", k 2 - kFloat : Decimal number or decimal number variable, e.g.: kFloat, "myfloat", 3.1415 kFloat, "myfloat", pi 3 - kString : Text or char* or String variable, e.g: kString, "mystr", "Hello" kString, "mystr", str Ein- und Ausgabeparameter Only variables of the executing script are permitted as values! -1 - kInt : Integer variable, e.g: -kInt, "myint", k -2 - kFloat : Decimal number variable, e.g: -kFloat, "myfloat", pi -3 - kString, char* variable, e.g: -kString, "mycharstr", str (with str defined as char* or char[N]) -4 : String variable, e.g.: -4, "mystr", str (with str defined as String) |
The example executes the script aaa.cpp of your desktop.
#include "internal/types.h"
int main () { int res; String str = string::alloc ();
res = run_cscript (0, "$DESKTOP/aaa.cpp", kString, "mystr", "Hello Paul", kInt, "myint", 123, kFloat, "myfloat", 3.1415926, -4, "strout", str); showmessage ("str = '%s'\nResult %d", str, res); return 0; }
// With aaa.cpp, for example, like this: // int main () { showmessage ("%s\n%d\n%f", mystr, myint, myfloat); string::set (strout, mystr); string::append (strout, " (from sub-script)");
return 0; }
Alphabetic index HTML hierarchy of classes or Java