Bookshelf Home | Contents | Index | Search | PDF |
Siebel VB Language Reference > Siebel VB Language Reference >
Lset Statement
This standard VB statement copies one string to another or assigns a user-defined type variable to another.
Syntax A
Lset string = string-expression
Syntax B
Lset variable1 = variable2
Returns
Not applicable
Usage
If string is shorter than string-expression, Lset copies the leftmost characters of string-expression into string. The number of characters copied is equal to the length of string.
If string is longer than string-expression, every character in string-expression is copied into string, filling it from left to right. Leftover characters in string are replaced with spaces.
In Syntax B, the number of characters copied is equal to the length of the shorter of variable1 and variable2.
Lset cannot be used to assign variables of different user-defined types if either contains a variant or a variable-length string.
Example
This example puts a user's last name into the variable
*c
. If the name is longer than the size oflastname
, then the user's name is truncated.Sub Button_Click
Dim lastname as String
Dim strlast as String * 8
lastname = "Smith"
Lset strlast = lastname
msgtext = "Your last name is: " & strlast
End SubSee Also
Bookshelf Home | Contents | Index | Search | PDF |
Siebel VB Language Reference Published: 18 June 2003 |