






Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!







Some VBScript variable conversion functions •^
CDATE() – Returns an expression that has beenconverted to a Variant of subtype Date.
-^
CINT() - Returns an expression that has beenconverted to a Variant of subtype Integer.
-^
CSTR() - Returns an expression that has beenconverted to a Variant of subtype String.
\ is integer divide
^ is power to (e.g. 3^2 is 3 squared.)
IF…THEN may be used to test ranges by using morecomplex inequalities.
-^
When using AND, both sides in () must be true.
If (I>=1) and (I<=9) then '1-9 Inclusive
When using OR operator, indicates that theinequality is true if the cows are home or the sun isdown.
If (Cows = Home) or (Sun = Down) Then
For more complex tests on a single variable, theSELECT CASE statement is preferred.
-^
Syntax:^ Select Case
myVarToBeTested
Case
Value
,^ Value
:
Case
Lower
TO
Upper
:
Case
Inequality
:
Case Else End Select
Loops allow the enclosed block of code to berepeated.
-^
There are two kinds: WHILE…WEND and FOR…NEXT.
-^
While loops until some condition is met. It is good foriterating datasets and files.
-^
For loops for a fixed duration. They are good forcounting or enumerating a known number of times.
For Loop Syntax For
myVar
Start
to
Stop
[Step
Value
Loop Body (block of code to be repeated) Next •^
Alternately you can use the alternate syntax For Each
myVar
in
myEnumeration
Loop Body Next
The WHILE…WEND loop can be used to loop basedon some inequality.
-^
As long as the condition evaluates to true, the blockof code inside is executed repeatedly. At the top ofthe loop, checks to see if the condition is still true, ifnot it exits the loop. I = 6While (I > 5)
I = I – 1 Wend