Workflow setGlobal

From Catglobe Wiki
Revision as of 11:24, 30 December 2024 by Administrator (talk | contribs) (Created page with "== Workflow_setGlobal== Set values for scripts invoked from workflow class ==Syntax== Workflow_setGlobal(string parameterName, AnyType value) == Return type == Empty == Exampl...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Workflow_setGlobal

Set values for scripts invoked from workflow class

Syntax

Workflow_setGlobal(string parameterName, AnyType value)

Return type

Empty

Examples

//Use on dynamic script 
string script = "
	number a = 1;
	return a + Workflow_getGlobal(\"x\");
";
WorkflowScript wf = new WorkflowScript (script, false);
Workflow_setGlobal("x", 10);
wf.Call();//11


//Use on existing wokflow
WorkflowScript wf = new WorkflowScript (wf);
Workflow_setGlobal("x", 10);
print(wf.Call());//11

// script get global value on the above wf:
number a = 1;
return a + Workflow_getGlobal("x");