Siebel VB Language Reference > Methods Reference for Siebel VB > Variable Manipulation Methods >
Assign Expression to Variable Statement
The Assign Expression to Variable statement is a predefined VB statement that assigns an expression to a Visual Basic variable. It does not return a value. You can use it to assign a value or expression to a variable that is of one of the following data types:
If you use this statement to assign a value to a numeric variable or to a string variable, then Siebel VB applies the standard conversion rules.
You can use this statement to assign a value to a field in a record or to assign a value to an element in an array.
The Let keyword is optional. Let is different from Set because Set assigns a variable to a COM object. For example:
Set o1 = o2. Sets the object reference.
Let o1 = o2. Sets the value of the default member.
[Let] variable = expression
The following table describes the arguments that you can use with this method.
The variable to which Siebel VB assigns a value.
The expression that contains the value that Siebel VB assigns.
The following example uses the Assign Expression to Variable statement for the sum variable. It calculates an average of 10 golf scores:
Dim score As Integer
Dim x, sum
Let sum = 34
For x = 1 to 10
score = 76
sum = sum + score
msgtext = "Your average is: " & CInt(sum/(x-1))
Declare Symbolic Constant Method