summaryrefslogtreecommitdiff
path: root/source/text/sbasic/shared/fragments.xhp
blob: 416149a86e91203f6f49558bb7b2ea79a2959537 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
<?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" name="Syntax fragments">Syntax fragments</link></variable></h1>
      <paragraph role="paragraph" id="par_id881587044839050">%PRODUCTNAME Basic syntax fragments.</paragraph>
    </section>
    
<section id="argument">
  <h2 id="hd_id431587045941514"><variable id="argumenth2"><link href="text/sbasic/shared/fragments.xhp" name="arguments in Function, Sub and Property statements"></link></variable></h2>
    <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 type-name|type-car}[ = expression]|[()]As Variant}</paragraph>
    </bascode>
    <embed href="text/sbasic/shared/00000003.xhp#functparameters"/>
    <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>type-car:</emph> Type declaration caracter.</paragraph>
    <paragraph role="paragraph" id="par_id651587044336713"><emph>type-name</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>
    <warning id="par_id851587050837107">Using<literal>ParamArray</literal> or <emph>= expression</emph> require <link href="text/sbasic/shared/compatible.xhp" name ="Option Compatible">Option Compatible</link> to be placed before the executable program code in a module. </warning>
</section>

<section id="array">
  <h2 id="hd_id231587046013456"><variable id="arrayh2"><link href="text/sbasic/shared/fragments.xhp" name="array syntax fragment"></link></variable></h2>
    <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>
    <embed href="text/sbasic/shared/00000003.xhp#functparameters"/>
    <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">
  <h2 id="hd_id231587046013458"><variable id="typenameh2"><link href="text/sbasic/shared/fragments.xhp" name="data types fragment"></link></variable></h2>
    <paragraph role="paragraph" id="par_id501586753339474"><image src="media/helpimg/sbasic/type-name_fragment.svg" id="img_id4157296484514"><alt xml-lang="en-US" id="alt_id15152796484515">data types fragment</alt></image></paragraph>
    <bascode>
      <paragraph role="bascode" id="par_id3150985" localize="false">{Currency|Date|Double|Integer|Long|Object|Single|String|Variant}</paragraph>
    </bascode>
</section>

<section id="typecar">
  <h2 id="hd_id231587046013459"><variable id="typecarh2"><link href="text/sbasic/shared/fragments.xhp" name="type declaration caracters fragment"></link></variable></h2>
    <paragraph role="paragraph" id="par_id511586753339474"><image src="media/helpimg/sbasic/type-car_fragment.svg" id="img_id4157296484514"><alt xml-lang="en-US" id="alt_id15152796484516">type declaration caracters</alt></image></paragraph>
    <bascode>
      <paragraph role="bascode" id="par_id3150986" localize="false">{ % | &amp; | ! | # | $ }</paragraph>
    </bascode>
</section>

  </body>
</helpdocument>