18.01.2015 Views

Technical Reference Manual - InduSoft

Technical Reference Manual - InduSoft

Technical Reference Manual - InduSoft

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Appendix: Built-in Scripting Language<br />

optStrArgument1, …, optStrArgumentN<br />

Values that are passed to the procedure's parameters. Arguments must be passed as strings.<br />

Returned value<br />

This function returns whatever value is returned by the called procedure.<br />

Examples<br />

Given the following procedure that is defined in the Procedures folder…<br />

Function AddMe(intNumber)<br />

If intNumber >= 6 Then<br />

AddMe = 0<br />

Else<br />

AddMe = intNumber + 2<br />

End If<br />

End Function<br />

…the procedure is run by calling the RunGlobalProcedureOnServer function…<br />

RunGlobalProcedureOnServer( "AddMe", "2" )<br />

…and it returns a value of 4.<br />

RunGlobalProcedureOnTrigger<br />

This function directly executes a global procedure when the value of a specified tag changes.<br />

Function Group Execution Windows Embedded Thin Client<br />

RunGlobalProcedureOnTrigger<br />

Module Activity Synchronous Supported Supported Supported<br />

Syntax<br />

RunGlobalProcedureOnTrigger("strTagName",strProcedureOnTrigger)<br />

RunGlobalProcedureOnTrigger( "strTagName", strProcedureOnTrigger )<br />

strTagName<br />

The name of a project tag.<br />

strProcedureOnTrigger<br />

Note: The tag name must be enclosed in quotes, as shown in the syntax<br />

diagram, or else the project will try to get the value of the named tag.<br />

The name of the procedure (i.e., a VBScript function or sub-routine defined in the Procedures<br />

folder) to run when the value of the specified tag changes.<br />

Returned value<br />

This function returns the following possible values:<br />

Value<br />

Description<br />

0 Error<br />

1 Success<br />

Page 614<br />

<strong>InduSoft</strong> Web Studio

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!