diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-27 16:51:28 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-27 16:51:28 +0000 |
commit | 940b4d1848e8c70ab7642901a68594e8016caffc (patch) | |
tree | eb72f344ee6c3d9b80a7ecc079ea79e9fba8676d /helpcontent2/source/text/sbasic/shared/03120308.xhp | |
parent | Initial commit. (diff) | |
download | libreoffice-upstream.tar.xz libreoffice-upstream.zip |
Adding upstream version 1:7.0.4.upstream/1%7.0.4upstream
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 | 83 |
1 files changed, 83 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..7ac77340e --- /dev/null +++ b/helpcontent2/source/text/sbasic/shared/03120308.xhp @@ -0,0 +1,83 @@ +<?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> + + +<paragraph id="hd_id3153345" role="heading" level="1" xml-lang="en-US"><link href="text/sbasic/shared/03120308.xhp" name="RSet Statement">RSet Statement</link></paragraph> +<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> + +<paragraph id="hd_id3149234" role="heading" level="2" xml-lang="en-US">Syntax:</paragraph> +<bascode> +<paragraph id="par_id3150669" role="bascode" xml-lang="en-US">RSet Text As String = Text or RSet Variable1 = Variable2</paragraph> +</bascode> + +<paragraph id="hd_id3156024" role="heading" level="2" xml-lang="en-US">Parameters:</paragraph> +<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> + +<paragraph id="hd_id3154909" role="heading" level="2" xml-lang="en-US">Example:</paragraph> +<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> +</body> + +</helpdocument>
\ No newline at end of file |