01-02-2013 10:54 AM
I am trying to use the Select Case to be something like below:
Select Case RedTemp
Case 20 to 30
WriteTemp = 10
Case Else
WriteTemp = 0
end select
It appears that the "TO" operator is not active in the Select Function in DiaDEM. I would just like to confirm this as being true and see if anyone may have a work around.
Thanks
01-03-2013 01:02 AM
Hello Blane63580,
We use Visual Basic Script (VBS) to automate DIAdem. Therefore we extended VBS so that it is able to understand the DIAdem commands. VBS is a subset of VBA and doesn't support "TO" for in the "select case" command. Here is the description of the VBS command “select case”and a small example:
Depending on the value of an expression, this Select Case conditional statement executes only one of several possible statement groups.
Select Case TestExpression
Case ExpressionList
Statements
[Case Else ExpressionList
else_statements]
End Select
| TestExpression | Any numeric expression or string expression. |
| ExpressionList | A list separated by commas with one or more expressions. |
| Statements | One or more statements to execute if the test expression agrees with one of the expression values in its Expressionlist_n. |
| else_statements | One or more statements to execute if the test expression does not correspond to any of the specified expressions. |
Dim iVal
iVal = InputBox("Please enter a value")
Select Case iVal
Case 1, 3, 5, 7, 9
Call MsgBox("Odd number")
Case 2, 4, 6, 8, 10
Call MsgBox("Even number")
Case Else
Call MsgBox("Number less than 1 or greater than 10")
End Select
Greetings
Walter