LSet Statement

Aligns a string to the left of a string variable, or copies a variable of a user-defined type to another variable of a different user-defined type.

Syntax:


LSet Var แƒ แƒแƒ’แƒแƒ แƒช แƒกแƒขแƒ แƒ˜แƒฅแƒแƒœแƒ˜ = แƒขแƒ”แƒฅแƒกแƒขแƒ˜ แƒแƒœ LSet Var1 = Var2

Parameters:

Var: แƒœแƒ”แƒ‘แƒ˜แƒกแƒ›แƒ˜แƒ”แƒ แƒ˜ แƒกแƒ แƒ˜แƒฅแƒแƒœแƒ˜แƒก แƒชแƒ•แƒšแƒแƒ“แƒ˜ แƒจแƒ”แƒ˜แƒชแƒแƒ•แƒก แƒกแƒขแƒ แƒ˜แƒฅแƒแƒœแƒก, แƒ แƒแƒ›แƒ”แƒšแƒ˜แƒช แƒ’แƒ˜แƒœแƒ“แƒแƒ—, แƒ แƒแƒ› แƒ’แƒแƒ“แƒแƒแƒœแƒแƒชแƒ•แƒšแƒแƒ— แƒ›แƒแƒ แƒชแƒฎแƒœแƒ˜แƒ•.

แƒขแƒ”แƒฅแƒกแƒขแƒ˜: แƒกแƒขแƒ แƒ˜แƒœแƒ’แƒ˜, แƒ แƒแƒ›แƒ”แƒšแƒ˜แƒช แƒ’แƒกแƒฃแƒ แƒ— แƒ’แƒแƒแƒกแƒฌแƒแƒ แƒแƒ— แƒ›แƒแƒ แƒฏแƒ•แƒœแƒ˜แƒ• แƒกแƒขแƒ แƒ˜แƒœแƒ’แƒ˜แƒก แƒชแƒ•แƒšแƒแƒ“แƒจแƒ˜.

Var1: Name of the user-defined type variable that you want to copy to.

Var2: Name of the user-defined type variable that you want to copy from.

If the string is shorter than the string variable, LSet left-aligns the string within the string variable. Any remaining positions in the string variable are replaced by spaces. If the string is longer than the string variable, only the leftmost characters up to the length of the string variable are copied. With the LSet statement, you can also copy a user-defined type variable to another variable of the same type.

Example:


Sub ExampleRLSet
Dim sVar As String
Dim sExpr As String
    sVar = String(40,"*")
    sExpr = "SBX"
    REM Align "SBX" 40 แƒกแƒ˜แƒ›แƒ‘แƒแƒšแƒ˜แƒแƒœแƒ˜ แƒกแƒขแƒ แƒ˜แƒฅแƒแƒœแƒ˜แƒก แƒกแƒแƒ–แƒฆแƒ•แƒ แƒ”แƒ‘แƒจแƒ˜
    ' Replace asterisks with spaces
    RSet sVar = sExpr
    Print ">"; sVar; "<"
    sVar = String(5,"*")
    sExpr = "123457896"
    RSet sVar = sExpr
    Print ">"; sVar; "<"
    sVar = String(40,"*")
    sExpr = "SBX"
    REM Align "SBX" 40 แƒกแƒ˜แƒ›แƒ‘แƒแƒšแƒ˜แƒแƒœแƒ˜ แƒกแƒขแƒ แƒ˜แƒฅแƒแƒœแƒ˜แƒก แƒกแƒแƒ–แƒฆแƒ•แƒ แƒ”แƒ‘แƒจแƒ˜
    LSet sVar = sExpr
    Print ">"; sVar; "<"
    sVar = String(5,"*")
    sExpr = "123456789"
    LSet sVar = sExpr
    Print ">"; sVar; "<"
End Sub

Please support us!