Let Statement

Assigns the value of an expression to a variable or property.

Syntax

[Let] varname = expression

The Let statement syntax has these parts:

Part Description
Let Optional. Explicit use of the Let keyword is a matter of style, but it is usually omitted.
varname Required. Name of the variable or property; follows standard variable naming conventions.
expression Required. Value assigned to the variable or property.

Remarks

In ConceptDraw Basic value expression, assigned to variable varname can be of any type. The type of expression will become the same as the type of varname.

If varname is of Variant type, then varname will be given the same type as expression. It's assumed that the Variant-variable varname has subtype identical to the type of expression.

Use the Set statement to assign object references to variables.

Example

This example assigns the values of expressions to variables using the explicit Let statement.

Dim MyStr, MyInt
' The following variable assignments use the Let statement.
Let MyStr = "Hello World"
Let MyInt = 5

The following are the same assignments without the Let statement.

Dim MyStr, MyInt
MyStr = "Hello World"
MyInt = 5

 

See Also

Data Type Summary, Set Statement, Const Statement