diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-07 09:06:44 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-07 09:06:44 +0000 |
commit | ed5640d8b587fbcfed7dd7967f3de04b37a76f26 (patch) | |
tree | 7a5f7c6c9d02226d7471cb3cc8fbbf631b415303 /helpcontent2/source/text/sbasic/shared/03120308.xhp | |
parent | Initial commit. (diff) | |
download | libreoffice-upstream.tar.xz libreoffice-upstream.zip |
Adding upstream version 4:7.4.7.upstream/4%7.4.7upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'helpcontent2/source/text/sbasic/shared/03120308.xhp')
-rw-r--r-- | helpcontent2/source/text/sbasic/shared/03120308.xhp | 86 |
1 files changed, 86 insertions, 0 deletions
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 @@ +<?xml version="1.0" encoding="UTF-8"?> +<helpdocument version="1.0"> +<!-- + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . +--> + +<meta> + <topic id="textsbasicshared03120308xml" indexer="include" status="PUBLISH"> + <title id="tit" xml-lang="en-US">RSet Statement</title> + <filename>/text/sbasic/shared/03120308.xhp</filename> + </topic> +</meta> + +<body> + + +<section id="rset"> +<bookmark xml-lang="en-US" branch="index" id="bm_id3153345"> + <bookmark_value>RSet statement</bookmark_value> +</bookmark> + + +<h1 id="hd_id3153345"><link href="text/sbasic/shared/03120308.xhp" name="RSet Statement">RSet Statement</link></h1> +<paragraph id="par_id3150503" role="paragraph" xml-lang="en-US">Right-aligns a string within a string variable, or copies a user-defined variable type into another.</paragraph> +</section> + +<embed href="text/sbasic/shared/00000003.xhp#functsyntax"/> +<bascode> +<paragraph id="par_id3150669" role="bascode" xml-lang="en-US">RSet Text As String = Text or RSet Variable1 = Variable2</paragraph> +</bascode> + +<embed href="text/sbasic/shared/00000003.xhp#functparameters"/> +<paragraph id="par_id3148552" role="paragraph" xml-lang="en-US"> <emph>Text:</emph> Any string variable.</paragraph> +<paragraph id="par_id3154924" role="paragraph" xml-lang="en-US"> <emph>Text</emph>: String that you want to right-align in the string variable.</paragraph> +<paragraph id="par_id3149456" role="paragraph" xml-lang="en-US"> <emph>Variable1:</emph> User-defined variable that is the target for the copied variable.</paragraph> +<paragraph id="par_id3153381" role="paragraph" xml-lang="en-US"> <emph>Variable2:</emph> User-defined variable that you want to copy to another variable.</paragraph> +<paragraph id="par_id3154140" role="paragraph" xml-lang="en-US">If the string is shorter than the string variable, <emph>RSet</emph> 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.</paragraph> +<paragraph id="par_id3149202" role="paragraph" xml-lang="en-US">You can also use the <emph>RSet statement</emph> to assign variables of one user-defined type to another.</paragraph> +<paragraph id="par_id3151042" role="paragraph" xml-lang="en-US">The following example uses the <emph>RSet</emph> and <emph>LSet</emph> statements to modify the left and right alignment of a string.</paragraph> + +<embed href="text/sbasic/shared/00000003.xhp#functexample"/> +<bascode> +<paragraph id="par_idm1341567472" role="bascode" localize="false" xml-lang="en-US">Sub ExampleRLSet</paragraph> +<paragraph id="par_idm1341566240" role="bascode" localize="false" xml-lang="en-US">Dim sVar As String</paragraph> +<paragraph id="par_idm1341565008" role="bascode" localize="false" xml-lang="en-US">Dim sExpr As String</paragraph> +<paragraph id="par_idm1341563776" role="bascode" localize="false" xml-lang="en-US"> sVar = String(40,"*")</paragraph> +<paragraph id="par_idm1341562528" role="bascode" localize="false" xml-lang="en-US"> sExpr = "SBX"</paragraph> +<paragraph id="par_id3155856" role="bascode" xml-lang="en-US"> ' Right-align "SBX" in a 40-character string</paragraph> +<paragraph id="par_id3152577" role="bascode" xml-lang="en-US"> ' Replace asterisks with spaces</paragraph> +<paragraph id="par_idm1341557824" role="bascode" localize="false" xml-lang="en-US"> RSet sVar = sExpr</paragraph> +<paragraph id="par_idm1341556592" role="bascode" localize="false" xml-lang="en-US"> Print ">"; sVar; "<"</paragraph> +<paragraph id="par_idm1341555344" role="bascode" localize="false" xml-lang="en-US"> sVar = String(5,"*")</paragraph> +<paragraph id="par_idm1341554096" role="bascode" localize="false" xml-lang="en-US"> sExpr = "123457896"</paragraph> +<paragraph id="par_idm1341552864" role="bascode" localize="false" xml-lang="en-US"> RSet sVar = sExpr</paragraph> +<paragraph id="par_idm1341551632" role="bascode" localize="false" xml-lang="en-US"> Print ">"; sVar; "<"</paragraph> +<paragraph id="par_idm1341550384" role="bascode" localize="false" xml-lang="en-US"> sVar = String(40,"*")</paragraph> +<paragraph id="par_idm1341549136" role="bascode" localize="false" xml-lang="en-US"> sExpr = "SBX"</paragraph> +<paragraph id="par_id3145801" role="bascode" xml-lang="en-US"> ' Left-align "SBX" in a 40-character string</paragraph> +<paragraph id="par_idm1341546160" role="bascode" localize="false" xml-lang="en-US"> LSet sVar = sExpr</paragraph> +<paragraph id="par_idm1341544928" role="bascode" localize="false" xml-lang="en-US"> Print ">"; sVar; "<"</paragraph> +<paragraph id="par_idm1341543680" role="bascode" localize="false" xml-lang="en-US"> sVar = String(5,"*")</paragraph> +<paragraph id="par_idm1341542432" role="bascode" localize="false" xml-lang="en-US"> sExpr = "123456789"</paragraph> +<paragraph id="par_idm1341541200" role="bascode" localize="false" xml-lang="en-US"> LSet sVar = sExpr</paragraph> +<paragraph id="par_idm1341539968" role="bascode" localize="false" xml-lang="en-US"> Print ">"; sVar; "<"</paragraph> +<paragraph id="par_idm1341538720" role="bascode" localize="false" xml-lang="en-US">End Sub</paragraph> +</bascode> +<section id="relatedtopics"> + <paragraph role="paragraph" id="par_id161599082457466" localize="false"><embedvar href="text/sbasic/shared/00000003.xhp#stringfunctions"/></paragraph> +</section> +</body> + +</helpdocument> |