18.01.2013 Views

VBScript Reference Manual for InduSoft Web Studio

VBScript Reference Manual for InduSoft Web Studio

VBScript Reference Manual for InduSoft Web Studio

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

<strong>InduSoft</strong> <strong>Web</strong> <strong>Studio</strong> <strong>VBScript</strong> <strong>Reference</strong> <strong>Manual</strong><br />

Comment Statements<br />

Comment statements are used to provide documentation comments with the code.<br />

Comment Statements<br />

Comments Description<br />

Rem Includes explanatory remarks in a program<br />

‘<br />

Includes explanatory remarks in a program (single quote)<br />

Control Flow Statements<br />

By default, <strong>VBScript</strong> sequentially moves (flows) through the script from statement to statement. As is<br />

typical with virtually all high-level programming languages, control flow statements can alter this flow by<br />

branching to other code sections based upon logic conditions, inputs, errors, etc.<br />

One of the most commonly used control flow statement is the If..Then..Else statement. This control<br />

flow statement takes the following <strong>for</strong>mat:<br />

{simple <strong>for</strong>mat} If condition Then statement(s) [Else elsestatement(s) ]<br />

{block <strong>for</strong>mat}<br />

If condition Then<br />

[statement(s)]<br />

[ElseIf condition-n Then<br />

[elseifstatement(s)]] . . .<br />

[Else<br />

[elsestatement(s)]]<br />

End If<br />

The condition can be a boolean constant or boolean variable, or a numeric or string expression that<br />

evaluates to True or False.<br />

Refer to the Appendix <strong>for</strong> a detail description of these functions.<br />

Control Flow Statements<br />

Function Description<br />

Do…Loop Repeats a block of statements while a condition is True or until a condition becomes True<br />

Execute Executes one or more specified statements<br />

Execute Global Executes one or more specified statements in the global namespace of a script<br />

Exit Do Exit a Do Loop Function. Transfers control to the statement following the Loop statement.<br />

Exit For Exit a For Loop Function (For…Next or For Each…Next loop). Transfers control to the<br />

statement following the Next statement.<br />

For...Next Repeats a group of statements a specified number of times<br />

For Each…Next Repeats a group of statements <strong>for</strong> each element in an array or collection<br />

If…Then…Else Conditionally executes a group of statements, depending on the value of an expression<br />

Select Case Executes one of several groups of statements, depending on the value of an expression<br />

While…Wend Executes a series of statements as long as a given condition is True<br />

With…End With Executes a series of statements on a single object<br />

<strong>InduSoft</strong>, Ltd. 19

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

Saved successfully!

Ooh no, something went wrong!