From ed5640d8b587fbcfed7dd7967f3de04b37a76f26 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sun, 7 Apr 2024 11:06:44 +0200 Subject: Adding upstream version 4:7.4.7. Signed-off-by: Daniel Baumann --- .../source/text/sbasic/shared/03120304.xhp | 84 ++++++++++++++++++++++ 1 file changed, 84 insertions(+) create mode 100644 helpcontent2/source/text/sbasic/shared/03120304.xhp (limited to 'helpcontent2/source/text/sbasic/shared/03120304.xhp') diff --git a/helpcontent2/source/text/sbasic/shared/03120304.xhp b/helpcontent2/source/text/sbasic/shared/03120304.xhp new file mode 100644 index 000000000..54567d6a0 --- /dev/null +++ b/helpcontent2/source/text/sbasic/shared/03120304.xhp @@ -0,0 +1,84 @@ + + + + + + + LSet Statement + /text/sbasic/shared/03120304.xhp + + + + + + +
+ + LSet statement + + + +

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. +
+ + + +LSet Var As String = Text or LSet Var1 = Var2 + + + + Var: Any String variable that contains the string that you want align to the left. + Text: String that you want to align to the left of the string variable. + 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. + + + +Sub ExampleRLSet +Dim sVar As String +Dim sExpr As String + sVar = String(40,"*") + sExpr = "SBX" + ' Align "SBX" within the 40-character reference string + ' Replace asterisks with spaces + RSet sVar = sExpr + Print ">"; sVar; "<" + sVar = String(5,"*") + sExpr = "123457896" + RSet sVar = sExpr + Print ">"; sVar; "<" + sVar = String(40,"*") + sExpr = "SBX" + ' Left-align "SBX" within the 40-character reference string + LSet sVar = sExpr + Print ">"; sVar; "<" + sVar = String(5,"*") + sExpr = "123456789" + LSet sVar = sExpr + Print ">"; sVar; "<" +End Sub + +
+ +
+ + +
-- cgit v1.2.3