Files
help/source/text/sbasic/shared/compatible.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

64 lines
4.8 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="text/sbasic/shared/compatible">
<title id="tit" localize="false" xml-lang="en-US">Option Compatible</title>
<filename>/text/sbasic/shared/compatible.xhp</filename>
</topic>
</meta>
<body>
<bookmark branch="index" localize="false" id="N8803">
<bookmark_value>Option Compatible</bookmark_value>
</bookmark>
<section id="optioncompatiblestatement">
<h1 id="N0104"><variable id="compatiblestatement"><link href="text/sbasic/shared/compatible.xhp">Option Compatible Statement</link></variable></h1>
<paragraph role="paragraph" id="N0106"><literal>Option Compatible</literal> extends %PRODUCTNAME Basic compiler and runtime, allowing supplemental language constructs to Basic.</paragraph>
</section>
<embed href="text/sbasic/shared/00000003.xhp#beforeexecutable"/>
<paragraph role="paragraph" id="N0107">This option may affect or assist in the following situations:</paragraph>
<list type="unordered">
<listitem><paragraph role="listitem" id="N0108">Allow special characters as identifiers. all characters that are defined as
letter in the Latin-1 (ISO 8859-1) character set, are accepted
as part of identifiers.</paragraph></listitem>
<listitem><paragraph role="listitem" id="N0109">Create <link href="text/sbasic/shared/03040000.xhp#addvbaconstants">VBA constants including non-printable characters</link>.</paragraph></listitem>
<listitem><paragraph role="listitem" id="N0110">Allow the <literal>New</literal> operator to be optional in <literal>Dim</literal> statements.</paragraph></listitem>
<listitem><paragraph role="listitem" id="N0112">Allow default values for optional parameters in procedures.</paragraph></listitem>
<listitem><paragraph role="listitem" id="N0113">Use named arguments when multiple optional parameters exist.</paragraph></listitem>
<listitem><paragraph role="listitem" id="N0114">Preload of %PRODUCTNAME Basic libraries</paragraph></listitem>
</list>
<note id="N0115"><literal>Option Compatible</literal> is required when coding class modules.</note>
<embed href="text/sbasic/shared/00000003.xhp#functsyntax"/>
<paragraph role="code" localize="false" id="N0117">Option Compatible</paragraph>
<embed href="text/sbasic/shared/00000003.xhp#functexample"/>
<h3 id="hd_id231561639199292">Special characters as identifiers</h3>
<bascode>
<paragraph role="bascode" id="par_id661561636654077" localize="false">Option Compatible</paragraph>
<paragraph role="bascode" id="par_id641581846957447">' With this option the code works, otherwise it causes a compiling error</paragraph>
<paragraph role="bascode" id="par_id921561636641311" localize="false">Sub Main</paragraph>
<paragraph role="bascode" id="par_id631561636632573" localize="false"> ä = 10</paragraph>
<paragraph role="bascode" id="par_id101561636625260" localize="false"> print ä</paragraph>
<paragraph role="bascode" id="par_id21561636616652" localize="false">End Sub</paragraph>
</bascode>
<tip id="par_id381561650119146">Statement <literal>Option VBAsupport 1</literal> implies <literal>Option Compatible</literal> statement automatically.</tip>
<section id="relatedtopics">
<embed href="text/sbasic/shared/03090407.xhp#remstatement"/>
<embed href="text/sbasic/shared/compatibilitymode.xhp#compatibilitymodeh1"/>
<embed href="text/sbasic/shared/03103200.xhp#optionbasestatement"/>
<embed href="text/sbasic/shared/03103300.xhp#explicitstatement"/>
<embed href="text/sbasic/shared/03103350.xhp#vbasupportstatement"/>
<embed href="text/sbasic/shared/classmodule.xhp#classmodulestatement"/>
<paragraph role="paragraph" id="N0131">Variables scope modification in <link href="text/sbasic/shared/01020300.xhp">Using Procedures and Functions</link> with <literal>CompatibilityMode()</literal> function.</paragraph>
<paragraph role="paragraph" id="N0129">Refer to <link href="text/sbasic/python/python_platform.xhp">Identifying the Operating System</link> and <link href="text/sbasic/python/python_session.xhp">Getting Session Information</link> for class module examples, or <link href="text/sbasic/guide/access2base.xhp">Access2Base shared Basic library</link> for other class examples making use of <literal>Option Compatible</literal> compiler mode.</paragraph>
</section>
</body>
</helpdocument>