Files
help/source/text/sbasic/shared/03120308.xhp
Ilmari Lauhakangas 7e42394ecb tdf#152323 drop name attribute from <link> elements
Replacement done with

find . -name \*.xhp -print0 |xargs -0 -P 0 perl -CS -pi -e \
        's#(<link[^>]*?) +name *="[^"]*" *( [^>]+|) *>#$1$2>#g'

(note some inconsistencies with space between name and = and also having
empty value, and some more complicated expression to also clear up
double space before/after the attribute)

translation files will be prepped with:

find */helpcontent2 -name \*.po -print0 |xargs -0 -P 0 perl -CS -pi -e \
    $'s#(<link[^>]*?) +name=(?:\\\\"[^"]*\\\\"|\'[^\']*\') *( [^>]+|) *(/?>)#$1$2$3#g unless /^#/'

(note that not all languages use the " as quote character for the
attributes, but that also single quotes appera in the po file. Hence
the use of the shell $'string' syntax to be able to quote ' as \'
It also requires to quote the backslash, so that it needs to be escaped
once for the shell, then another time for perl. Also don't work on
obsolete strings (those are prefixed with #~ in the po files)
Also note that <link..></link> gets turned into <link ../> during
translation extraction (along with removal of the space between the
attribute name and the value), so the pattern needs to be slightly
different here)

Change-Id: I95e53a08e6b0095cd894109ea0de154cc4859d8f
Reviewed-on: https://gerrit.libreoffice.org/c/help/+/143713
Tested-by: Jenkins
Reviewed-by: Christian Lohmaier <lohmaier+LibreOffice@googlemail.com>
2022-12-07 17:39:02 +00:00

87 lines
6.2 KiB
XML

<?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">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 "&gt;"; sVar; "&lt;"</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 "&gt;"; sVar; "&lt;"</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 "&gt;"; sVar; "&lt;"</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 "&gt;"; sVar; "&lt;"</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>