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/03120308.xhp | 86 ++++++++++++++++++++++ 1 file changed, 86 insertions(+) create mode 100644 helpcontent2/source/text/sbasic/shared/03120308.xhp (limited to 'helpcontent2/source/text/sbasic/shared/03120308.xhp') diff --git a/helpcontent2/source/text/sbasic/shared/03120308.xhp b/helpcontent2/source/text/sbasic/shared/03120308.xhp new file mode 100644 index 000000000..e527399c5 --- /dev/null +++ b/helpcontent2/source/text/sbasic/shared/03120308.xhp @@ -0,0 +1,86 @@ + + + + + + + RSet Statement + /text/sbasic/shared/03120308.xhp + + + + + + +
+ + RSet statement + + + +

RSet Statement

+Right-aligns a string within a string variable, or copies a user-defined variable type into another. +
+ + + +RSet Text As String = Text or RSet Variable1 = Variable2 + + + + Text: Any string variable. + Text: String that you want to right-align in the string variable. + Variable1: User-defined variable that is the target for the copied variable. + Variable2: User-defined variable that you want to copy to another variable. +If the string is shorter than the string variable, RSet aligns the string to the right within the string variable. Any remaining characters in the string variable are replaced with spaces. If the string is longer than the string variable, characters exceeding the length of the variable are truncated, and only the remaining characters are right-aligned within the string variable. +You can also use the RSet statement to assign variables of one user-defined type to another. +The following example uses the RSet and LSet statements to modify the left and right alignment of a string. + + + +Sub ExampleRLSet +Dim sVar As String +Dim sExpr As String + sVar = String(40,"*") + sExpr = "SBX" + ' Right-align "SBX" in a 40-character 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" in a 40-character string + LSet sVar = sExpr + Print ">"; sVar; "<" + sVar = String(5,"*") + sExpr = "123456789" + LSet sVar = sExpr + Print ">"; sVar; "<" +End Sub + +
+ +
+ + +
-- cgit v1.2.3