forked from amazingfate/help
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>
71 lines
5.4 KiB
XML
71 lines
5.4 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/.
|
|
*
|
|
-->
|
|
<meta>
|
|
<topic id="org.LibreOffice.sBasic.fragments.en" indexer="include" status="PUBLISH">
|
|
<title id="tit" xml-lang="en-US">Basic syntax diagrams fragments</title>
|
|
<filename>/text/sbasic/shared/fragments.xhp</filename>
|
|
</topic>
|
|
</meta>
|
|
<body>
|
|
<section id="fragments">
|
|
<h1 id="hd_id541587044867073"><variable id="fragmentsh1"><link href="text/sbasic/shared/fragments.xhp">Syntax fragments</link></variable></h1>
|
|
<paragraph role="paragraph" id="par_id881587044839050">%PRODUCTNAME Basic syntax fragments.</paragraph>
|
|
</section>
|
|
|
|
<section id="argument">
|
|
<h4 id="hd_id431587045941514"><variable id="argumenth2"><link href="text/sbasic/shared/fragments.xhp"></link>argument fragment</variable></h4>
|
|
<paragraph role="paragraph" id="par_id491585753339474"><image src="media/helpimg/sbasic/argument_fragment.svg" id="img_id4156296484514"><alt xml-lang="en-US" id="alt_id15152796484514">argument fragment</alt></image></paragraph>
|
|
<bascode>
|
|
<paragraph role="bascode" id="par_id3151084" localize="false">{[Optional [ByRef|ByVal]]|ParamArray} argument {{As typename|char}[ = expression]|[()]As Variant}</paragraph>
|
|
</bascode>
|
|
<h4 id="hd_id811587303969210">Parameters</h4>
|
|
<paragraph role="paragraph" id="par_id481586090298901"><literal>Optional</literal>: The argument is not mandatory.</paragraph>
|
|
<paragraph role="paragraph" id="par_id331586090532804"><literal>ByRef</literal>: The argument is passed by reference. <literal>ByRef</literal> is the default.</paragraph>
|
|
<paragraph role="paragraph" id="par_id331586090432804"><literal>ByVal</literal>: The argument is passed by value. Its value can be modified by the called routine.</paragraph>
|
|
<paragraph role="paragraph" id="par_id651587044335713"><emph>char:</emph> Type declaration character.</paragraph>
|
|
<paragraph role="paragraph" id="par_id651587044336713"><emph>typename</emph>: Primitive data type name. Library or module defined types can also be specified.</paragraph>
|
|
<paragraph role="paragraph" id="par_id11587045141290"><emph>= expression</emph>: Specify a default value for the argument, matching its declared type. <literal>Optional</literal> is necessary for each argument specifying a default value.</paragraph>
|
|
<paragraph role="paragraph" id="par_id331586091432804"><literal>ParamArray</literal>: Use <literal>ParamArray</literal> when the number of parameters is undetermined. A typical scenario is that of a Calc user-defined function. Using <literal>ParamArray</literal> should be limited to the last argument of a routine.</paragraph>
|
|
<tip id="par_id851587050837107">Using<literal>ParamArray</literal> or <emph>= expression</emph> require <link href="text/sbasic/shared/compatible.xhp">Option Compatible</link> to be placed before the executable program code in a module.</tip>
|
|
<warning id="par_id391587571321063">When using <link href="text/sbasic/shared/vbasupport.xhp">Option VBASupport 1</link>, <literal>Optional</literal> arguments with no default value (<emph>= expression</emph>) are initialized according to their data type, except if <literal>Variant</literal>.</warning>
|
|
</section>
|
|
|
|
<section id="array">
|
|
<h4 id="hd_id231587046013456"><variable id="arrayh4"><link href="text/sbasic/shared/fragments.xhp">array fragment</link></variable></h4>
|
|
<paragraph role="paragraph" id="par_id491586753339473"><image src="media/helpimg/sbasic/array_fragment.svg" id="img_id4156296484514"><alt xml-lang="en-US" id="alt_id15152796484514">array fragment</alt></image></paragraph>
|
|
<bascode>
|
|
<paragraph role="bascode" id="par_id3150983" localize="false">( [[start To] end], .. )</paragraph>
|
|
</bascode>
|
|
<h4 id="hd_id731587304120258">Parameters</h4>
|
|
<paragraph role="paragraph" id="par_id951587051619162"><emph>start:</emph> Lower bound of a dimension.</paragraph>
|
|
<paragraph role="paragraph" id="par_id951587052619162"><emph>end:</emph> Upper bound of a dimension.</paragraph>
|
|
<paragraph role="paragraph" id="par_id961587051702571">Multiple dimensions for an array are denoted using comma (<emph>,</emph>) sign.</paragraph>
|
|
</section>
|
|
|
|
<section id="typename">
|
|
<h4 id="hd_id231587046013458"><variable id="typenameh4">typename fragment</variable></h4>
|
|
<paragraph role="paragraph" id="par_id501586753339474"><image src="media/helpimg/sbasic/typename_fragment.svg" id="img_id4157296484514"><alt xml-lang="en-US" id="alt_id15152796484515">primitive data types fragment</alt></image></paragraph>
|
|
<bascode>
|
|
<paragraph role="bascode" id="par_id3150985" localize="false">{Boolean|Byte|Currency|Date|Double|Integer|Long|Object|Single|String|Variant}</paragraph>
|
|
</bascode>
|
|
</section>
|
|
|
|
<section id="char">
|
|
<h4 id="hd_id231587046013459"><variable id="charh4">char fragment</variable></h4>
|
|
<paragraph role="paragraph" id="par_id511586753339474"><image src="media/helpimg/sbasic/char_fragment.svg" id="img_id4157296484514"><alt xml-lang="en-US" id="alt_id15152796484516">type declaration characters</alt></image></paragraph>
|
|
<bascode>
|
|
<paragraph role="bascode" id="par_id3150986" localize="false">{ % | & | ! | # | $ | @ }</paragraph>
|
|
</bascode>
|
|
</section>
|
|
|
|
</body>
|
|
</helpdocument>
|