diff options
author | Alain Romedenne <LibreOfficiant@sfr.fr> | 2020-09-21 16:04:09 +0200 |
---|---|---|
committer | Olivier Hallot <olivier.hallot@libreoffice.org> | 2020-09-29 12:28:19 +0200 |
commit | 78dc9c1d059b48ad79620f0cc536466e701a042d (patch) | |
tree | e6f03a300d8fa4697327695da5c8f1c67b565112 /source | |
parent | b908b46979dcf004ee504ca95b64a0c9441a3164 (diff) |
tdf#131416 Basic Syntax Diagrams for Defxxx statements
- Basic language ref . toc additions
- Letter range option addition
- DefBool-based refactoring
Change-Id: I5744c63e9c21ad5ff2801cd03a119fd2c747fef3
Reviewed-on: https://gerrit.libreoffice.org/c/help/+/103056
Tested-by: Jenkins
Tested-by: Olivier Hallot <olivier.hallot@libreoffice.org>
Reviewed-by: Olivier Hallot <olivier.hallot@libreoffice.org>
Diffstat (limited to 'source')
-rw-r--r-- | source/auxiliary/sbasic.tree | 3 | ||||
-rw-r--r-- | source/media/helpimg/sbasic/Defxxx_statements.svg | 52 | ||||
-rw-r--r-- | source/text/sbasic/shared/03101100.xhp | 56 | ||||
-rw-r--r-- | source/text/sbasic/shared/03101110.xhp | 13 | ||||
-rw-r--r-- | source/text/sbasic/shared/03101130.xhp | 11 | ||||
-rw-r--r-- | source/text/sbasic/shared/03101140.xhp | 12 | ||||
-rw-r--r-- | source/text/sbasic/shared/03101300.xhp | 12 | ||||
-rw-r--r-- | source/text/sbasic/shared/03101400.xhp | 10 | ||||
-rw-r--r-- | source/text/sbasic/shared/03101500.xhp | 10 | ||||
-rw-r--r-- | source/text/sbasic/shared/03101600.xhp | 12 | ||||
-rw-r--r-- | source/text/sbasic/shared/03101700.xhp | 10 | ||||
-rw-r--r-- | source/text/sbasic/shared/03102000.xhp | 34 |
12 files changed, 140 insertions, 95 deletions
diff --git a/source/auxiliary/sbasic.tree b/source/auxiliary/sbasic.tree index 879c1f844f..1db5006a29 100644 --- a/source/auxiliary/sbasic.tree +++ b/source/auxiliary/sbasic.tree @@ -117,11 +117,14 @@ <topic id="sbasic/text/sbasic/shared/03140000.xhp">DDB Function [VBA]</topic> <topic id="sbasic/text/sbasic/shared/03090403.xhp">Declare Statement</topic> <topic id="sbasic/text/sbasic/shared/03101100.xhp">DefBool Statement</topic> + <topic id="sbasic/text/sbasic/shared/03101110.xhp">DefCur Statement</topic> <topic id="sbasic/text/sbasic/shared/03101300.xhp">DefDate Statement</topic> <topic id="sbasic/text/sbasic/shared/03101400.xhp">DefDbl Statement</topic> <topic id="sbasic/text/sbasic/shared/03101500.xhp">DefInt Statement</topic> <topic id="sbasic/text/sbasic/shared/03101600.xhp">DefLng Statement</topic> <topic id="sbasic/text/sbasic/shared/03101700.xhp">DefObj Statement</topic> + <topic id="sbasic/text/sbasic/shared/03101130.xhp">DefSng Statement</topic> + <topic id="sbasic/text/sbasic/shared/03101140.xhp">DefStr Statement</topic> <topic id="sbasic/text/sbasic/shared/03102000.xhp">DefVar Statement</topic> <topic id="sbasic/text/sbasic/shared/03131900.xhp">DialogLibraries object</topic> <topic id="sbasic/text/sbasic/shared/03104300.xhp">DimArray Function</topic> diff --git a/source/media/helpimg/sbasic/Defxxx_statements.svg b/source/media/helpimg/sbasic/Defxxx_statements.svg new file mode 100644 index 0000000000..c438bf4080 --- /dev/null +++ b/source/media/helpimg/sbasic/Defxxx_statements.svg @@ -0,0 +1,52 @@ +<svg class="railroad-diagram" height="270" viewBox="0 0 697.0 270" width="697.0" xmlns="http://www.w3.org/2000/svg"> +<g transform="translate(.5 .5)"> +<style>/* <![CDATA[ */ + svg.railroad-diagram { + background-color:transparent; + } + svg.railroad-diagram path { + stroke-width:1; + stroke:black; + fill:rgba(0,0,0,0); + } + svg.railroad-diagram text { + font:bold 14px monospace; + font-family: Verdana, sans-serif; + text-anchor:middle; + } + svg.railroad-diagram text.label{ + text-anchor:start; + } + svg.railroad-diagram text.comment{ + font:italic 12px monospace; + } + svg.railroad-diagram rect{ + stroke-width:1; + stroke:black; + fill:transparent; + } + +/* ]]> */ +</style><g> +<path d="M20 125v20m10 -20v20m-10 -10h20"></path></g><g> +<path d="M40 135h0.0"></path><path d="M370.5 135h0.0"></path><path d="M40.0 135a15 15 0 0 0 15 -15v-85a15 15 0 0 1 15 -15h124.5"></path><path d="M224.5 250h116.0a15 15 0 0 0 15 -15v-85a15 15 0 0 1 15 -15"></path><path d="M40.0 135h15"></path><g> +<path d="M55.0 135h0.0"></path><path d="M194.5 135h0.0"></path><path d="M55.0 135a15 15 0 0 0 15 -15v-12a15 15 0 0 1 15 -15"></path><g class="terminal"> +<path d="M85.0 93h4.25"></path><path d="M160.25 93h4.25"></path><rect height="22" rx="10" ry="10" width="71.0" x="89.25" y="82"></rect><text x="124.75" y="97">DefCur</text></g><path d="M164.5 93a15 15 0 0 1 15 15v12a15 15 0 0 0 15 15"></path><path d="M55.0 135a15 15 0 0 0 15 -15v-54a15 15 0 0 1 15 -15"></path><g class="terminal"> +<path d="M85.0 51h0.0"></path><path d="M164.5 51h0.0"></path><rect height="22" rx="10" ry="10" width="79.5" x="85.0" y="40"></rect><text x="124.75" y="55">DefBool</text></g><path d="M164.5 51a15 15 0 0 1 15 15v54a15 15 0 0 0 15 15"></path><path d="M55.0 135h30"></path><g class="terminal"> +<path d="M85.0 135h0.0"></path><path d="M164.5 135h0.0"></path><rect height="22" rx="10" ry="10" width="79.5" x="85.0" y="124"></rect><text x="124.75" y="139">DefDate</text></g><path d="M164.5 135h30"></path><path d="M55.0 135a15 15 0 0 1 15 15v12a15 15 0 0 0 15 15"></path><g class="terminal"> +<path d="M85.0 177h4.25"></path><path d="M160.25 177h4.25"></path><rect height="22" rx="10" ry="10" width="71.0" x="89.25" y="166"></rect><text x="124.75" y="181">DefDbl</text></g><path d="M164.5 177a15 15 0 0 0 15 -15v-12a15 15 0 0 1 15 -15"></path><path d="M55.0 135a15 15 0 0 1 15 15v54a15 15 0 0 0 15 15"></path><g class="terminal"> +<path d="M85.0 219h4.25"></path><path d="M160.25 219h4.25"></path><rect height="22" rx="10" ry="10" width="71.0" x="89.25" y="208"></rect><text x="124.75" y="223">DefInt</text></g><path d="M164.5 219a15 15 0 0 0 15 -15v-54a15 15 0 0 1 15 -15"></path></g><path d="M194.5 135a15 15 0 0 1 15 15v85a15 15 0 0 0 15 15"></path><path d="M194.5 20a15 15 0 0 1 15 15v85a15 15 0 0 0 15 15"></path><g> +<path d="M224.5 135h0.0"></path><path d="M355.5 135h0.0"></path><path d="M224.5 135a15 15 0 0 0 15 -15v-12a15 15 0 0 1 15 -15"></path><g class="terminal"> +<path d="M254.5 93h0.0"></path><path d="M325.5 93h0.0"></path><rect height="22" rx="10" ry="10" width="71.0" x="254.5" y="82"></rect><text x="290.0" y="97">DefObj</text></g><path d="M325.5 93a15 15 0 0 1 15 15v12a15 15 0 0 0 15 15"></path><path d="M224.5 135a15 15 0 0 0 15 -15v-54a15 15 0 0 1 15 -15"></path><g class="terminal"> +<path d="M254.5 51h0.0"></path><path d="M325.5 51h0.0"></path><rect height="22" rx="10" ry="10" width="71.0" x="254.5" y="40"></rect><text x="290.0" y="55">DefLng</text></g><path d="M325.5 51a15 15 0 0 1 15 15v54a15 15 0 0 0 15 15"></path><path d="M224.5 135h30"></path><g class="terminal"> +<path d="M254.5 135h0.0"></path><path d="M325.5 135h0.0"></path><rect height="22" rx="10" ry="10" width="71.0" x="254.5" y="124"></rect><text x="290.0" y="139">DefSng</text></g><path d="M325.5 135h30"></path><path d="M224.5 135a15 15 0 0 1 15 15v12a15 15 0 0 0 15 15"></path><g class="terminal"> +<path d="M254.5 177h0.0"></path><path d="M325.5 177h0.0"></path><rect height="22" rx="10" ry="10" width="71.0" x="254.5" y="166"></rect><text x="290.0" y="181">DefStr</text></g><path d="M325.5 177a15 15 0 0 0 15 -15v-12a15 15 0 0 1 15 -15"></path><path d="M224.5 135a15 15 0 0 1 15 15v54a15 15 0 0 0 15 15"></path><g class="terminal"> +<path d="M254.5 219h0.0"></path><path d="M325.5 219h0.0"></path><rect height="22" rx="10" ry="10" width="71.0" x="254.5" y="208"></rect><text x="290.0" y="223">DefVar</text></g><path d="M325.5 219a15 15 0 0 0 15 -15v-54a15 15 0 0 1 15 -15"></path></g><path d="M355.5 135h15"></path></g><path d="M370.5 135h10"></path><g> +<path d="M380.5 135h0.0"></path><path d="M647.0 135h0.0"></path><path d="M380.5 135h15"></path><g> +<path d="M395.5 135h0.0"></path><path d="M632.0 135h0.0"></path><path d="M395.5 135a15 15 0 0 0 15 -15v-12a15 15 0 0 1 15 -15"></path><g> +<path d="M425.5 93h0.0"></path><path d="M602.0 93h0.0"></path><g class="terminal"> +<path d="M425.5 93h0.0"></path><path d="M479.5 93h0.0"></path><rect height="22" rx="10" ry="10" width="54.0" x="425.5" y="82"></rect><text x="452.5" y="97">char</text></g><path d="M479.5 93h10"></path><path d="M489.5 93h10"></path><g class="terminal"> +<path d="M499.5 93h0.0"></path><path d="M528.0 93h0.0"></path><rect height="22" rx="10" ry="10" width="28.5" x="499.5" y="82"></rect><text x="513.75" y="97">-</text></g><path d="M528.0 93h10"></path><path d="M538.0 93h10"></path><g class="terminal"> +<path d="M548.0 93h0.0"></path><path d="M602.0 93h0.0"></path><rect height="22" rx="10" ry="10" width="54.0" x="548.0" y="82"></rect><text x="575.0" y="97">char</text></g></g><path d="M602.0 93a15 15 0 0 1 15 15v12a15 15 0 0 0 15 15"></path><path d="M395.5 135h30"></path><g class="terminal"> +<path d="M425.5 135h61.25"></path><path d="M540.75 135h61.25"></path><rect height="22" rx="10" ry="10" width="54.0" x="486.75" y="124"></rect><text x="513.75" y="139">char</text></g><path d="M602.0 135h30"></path></g><path d="M632.0 135h15"></path><path d="M395.5 135a15 15 0 0 0 -15 15v12a15 15 0 0 0 15 15"></path><g class="terminal"> +<path d="M395.5 177h104.0"></path><path d="M528.0 177h104.0"></path><rect height="22" rx="10" ry="10" width="28.5" x="499.5" y="166"></rect><text x="513.75" y="181">,</text></g><path d="M632.0 177a15 15 0 0 0 15 -15v-12a15 15 0 0 0 -15 -15"></path></g><path d="M647.0 135h10"></path><path d="M 657.0 135 h 20 m -10 -10 v 20 m 10 -20 v 20"></path></g></svg>
\ No newline at end of file diff --git a/source/text/sbasic/shared/03101100.xhp b/source/text/sbasic/shared/03101100.xhp index e8b996221f..fdc15a3613 100644 --- a/source/text/sbasic/shared/03101100.xhp +++ b/source/text/sbasic/shared/03101100.xhp @@ -32,41 +32,47 @@ <bookmark_value>DefBool statement</bookmark_value> </bookmark> -<paragraph id="hd_id3145759" role="heading" level="1" xml-lang="en-US"><link href="text/sbasic/shared/03101100.xhp" name="DefBool Statement">DefBool Statement</link></paragraph> -<paragraph id="par_id3153089" role="paragraph" xml-lang="en-US">If no type-declaration character or keyword is specified, the DefBool statement sets the default data type for variables, according to a letter range.</paragraph> +<h1 id="hd_id3145759"><link href="text/sbasic/shared/03101100.xhp" name="DefBool Statement">DefBool Statement</link></h1> +<paragraph id="par_id3153089" role="paragraph">If no type-declaration character or keyword is specified, the DefBool statement sets the default data type for variables, according to a letter range.</paragraph> </section> <section id="PrefixDefCommon"> -<paragraph id="hd_id3149495" role="heading" level="2" xml-lang="en-US">Syntax:</paragraph> -<bascode> -<paragraph id="par_id3150682" role="bascode" xml-lang="en-US">Defxxx Characterrange1[, Characterrange2[,...]]</paragraph> -</bascode> + <embed href="text/sbasic/shared/00000003.xhp#functsyntax"/> + <paragraph role="paragraph" id="par_id971587473488701"> + <image src="media/helpimg/sbasic/Defxxx_statements.svg" id="img_id4156296484514"><alt xml-lang="en-US" id="alt_id15152796484514">DefType statements diagram</alt></image> + </paragraph> + <bascode> + <paragraph id="par_id3150682" role="bascode" localize="false">{DefBool|DefCur|DefDate|DefDbl|DefInt|DefLng|DefObj|DefStr|DefSng|DefVar} {char|char-char}[,...]</paragraph> + </bascode> + + <embed href="text/sbasic/shared/00000003.xhp#functparameters"/> -<paragraph id="hd_id3159201" role="heading" level="2" xml-lang="en-US">Parameters:</paragraph> -<paragraph id="par_id3147226" role="paragraph" xml-lang="en-US"> <emph>Characterrange:</emph> Letters that specify the range of variables that you want to set the default data type for.</paragraph> -<paragraph id="par_id3149178" role="paragraph" xml-lang="en-US"> <emph>xxx:</emph> Keyword that defines the default variable type:</paragraph> -<paragraph id="par_id3150669" role="paragraph" xml-lang="en-US"> <emph>Keyword: </emph>Default variable type</paragraph> + <paragraph id="par_id3147336" role="paragraph"> <emph>char:</emph> Letter prefix that specifies default data type for variables.</paragraph> + <paragraph id="par_id3147226" role="paragraph"> <emph>char-char:</emph> Letter range prefixes that specify default data type for variables.</paragraph> </section> -<paragraph id="par_id3149233" role="paragraph" xml-lang="en-US"> <emph>DefBool:</emph> Boolean</paragraph> <section id="ExamplePrefixDefCommon"> -<paragraph id="hd_id3149762" role="heading" level="2" xml-lang="en-US">Example:</paragraph> -<bascode> -<paragraph id="par_id3156152" role="bascode" xml-lang="en-US">' Prefix definition for variable types:</paragraph> -<paragraph id="par_idm1341573120" role="bascode" localize="false" xml-lang="en-US">DefBool b</paragraph> -<paragraph id="par_idm1341571888" role="bascode" localize="false" xml-lang="en-US">DefDate t</paragraph> -<paragraph id="par_idm1341570656" role="bascode" localize="false" xml-lang="en-US">DefDbl d</paragraph> -<paragraph id="par_idm1341569424" role="bascode" localize="false" xml-lang="en-US">DefInt i</paragraph> -<paragraph id="par_idm1341568192" role="bascode" localize="false" xml-lang="en-US">DefLng l</paragraph> -<paragraph id="par_idm1341566960" role="bascode" localize="false" xml-lang="en-US">DefObj o</paragraph> -<paragraph id="par_idm1341565728" role="bascode" localize="false" xml-lang="en-US">DefVar v</paragraph> + <embed href="text/sbasic/shared/00000003.xhp#functexample"/> + <bascode> + <paragraph id="par_id3156152" role="bascode" xml-lang="en-US">' Prefix definitions for variable types:</paragraph> + <paragraph id="par_idm1341573120" role="bascode" localize="false">DefBool b</paragraph> + <paragraph id="par_idm1341571778" role="bascode" localize="false">DefCur c,k-m</paragraph> + <paragraph id="par_idm1341571888" role="bascode" localize="false">DefDate t</paragraph> + <paragraph id="par_idm1341570656" role="bascode" localize="false">DefDbl f</paragraph> + <paragraph id="par_idm1341569424" role="bascode" localize="false">DefInt i-k,N</paragraph> + <paragraph id="par_idm1341568192" role="bascode" localize="false">DefLng x-z, D</paragraph> + <paragraph id="par_idm1341566960" role="bascode" localize="false">DefObj U, o-R</paragraph> + <paragraph id="par_idm1352566960" role="bascode" localize="false">DefSng w,a</paragraph> + <paragraph id="par_idm1341676960" role="bascode" localize="false">DefStr s</paragraph> + <paragraph id="par_idm1341565728" role="bascode" localize="false">DefVar V,g,E</paragraph> </bascode> </section> <bascode> -<paragraph id="par_idm1341564496" role="bascode" localize="false" xml-lang="en-US">Sub ExampleDefBool</paragraph> -<paragraph id="par_id3151381" role="bascode" xml-lang="en-US"> bOK=TRUE ' bOK is an implicit boolean variable</paragraph> -<paragraph id="par_idm1341561520" role="bascode" localize="false" xml-lang="en-US">End Sub</paragraph> + <paragraph id="par_idm1341564496" role="bascode" localize="false">Sub ExampleDefBool</paragraph> + <paragraph id="par_id3152481" role="bascode" xml-lang="en-US"> Print TypeName(Boole), VarType(Babbage), bitcoin ' Displays: Boolean 11 False</paragraph> + <paragraph id="par_id3151381" role="bascode" xml-lang="en-US"> bOK=True ' bOK is an implicit boolean variable</paragraph> + <paragraph id="par_idm1341561520" role="bascode" localize="false">End Sub</paragraph> </bascode> -</body> +</body> </helpdocument> diff --git a/source/text/sbasic/shared/03101110.xhp b/source/text/sbasic/shared/03101110.xhp index 811225a306..f9774f48c6 100644 --- a/source/text/sbasic/shared/03101110.xhp +++ b/source/text/sbasic/shared/03101110.xhp @@ -25,7 +25,7 @@ <filename>/text/sbasic/shared/03101110.xhp</filename> </topic> <history> -<created date="2005-04-25T15:14:37">DefCurr</created> +<created date="2005-04-25T15:14:37">DefCur</created> </history> </meta> <body> @@ -37,15 +37,14 @@ </section> <embed href="text/sbasic/shared/03101100.xhp#PrefixDefCommon"/> -<paragraph role="paragraph" id="par_idN105B0" xml-lang="en-US"> -<emph>DefCur:</emph> Currency</paragraph> <embed href="text/sbasic/shared/03101100.xhp#ExamplePrefixDefCommon"/> <bascode> -<paragraph role="bascode" id="par_idN105D3" xml-lang="en-US" localize="false">DefCur c</paragraph> -<paragraph role="bascode" id="par_idN105D6" xml-lang="en-US" localize="false">Sub ExampleDefCur</paragraph> -<paragraph role="bascode" id="par_idN105D9" xml-lang="en-US"> cCur=Currency ' cCur is an implicit currency variable.</paragraph> -<paragraph role="bascode" id="par_idN105DC" xml-lang="en-US" localize="false">End Sub</paragraph> + <paragraph role="bascode" id="par_idN105D6" localize="false">Sub ExampleDefCur</paragraph> + <paragraph role="bascode" id="par_idN105D8" xml-lang="en-US"> Print liquid, Typename(coinbit), VarType(money) ' Result is: 0.0000 Currency 6</paragraph> + <paragraph role="bascode" id="par_idN105D9" xml-lang="en-US"> cCur=Currency ' cCur is an implicit currency variable.</paragraph> + <paragraph role="bascode" id="par_idN105DC" localize="false">End Sub</paragraph> </bascode> + </body> </helpdocument> diff --git a/source/text/sbasic/shared/03101130.xhp b/source/text/sbasic/shared/03101130.xhp index 24b4deb94b..7fbd6cc989 100644 --- a/source/text/sbasic/shared/03101130.xhp +++ b/source/text/sbasic/shared/03101130.xhp @@ -32,19 +32,18 @@ <bookmark_value>DefSng statement</bookmark_value> </bookmark> -<paragraph id="par_idN10577" role="heading" level="1" xml-lang="en-US"><link href="text/sbasic/shared/03101130.xhp">DefSng Statement</link></paragraph> +<h1 id="par_idN10577"><link href="text/sbasic/shared/03101130.xhp">DefSng Statement</link></h1> <paragraph id="par_idN10587" role="paragraph" xml-lang="en-US">If no type-declaration character or keyword is specified, the DefSng statement sets the default variable type, according to a letter range.</paragraph> </section> <embed href="text/sbasic/shared/03101100.xhp#PrefixDefCommon"/> -<paragraph id="par_idN105AA" role="paragraph" xml-lang="en-US"> <emph>DefSng:</emph> Single</paragraph> <embed href="text/sbasic/shared/03101100.xhp#ExamplePrefixDefCommon"/> <bascode> -<paragraph id="par_idm1341233824" role="bascode" localize="false" xml-lang="en-US">DefSng s</paragraph> -<paragraph id="par_idm1341232592" role="bascode" localize="false" xml-lang="en-US">Sub ExampleDefSng</paragraph> -<paragraph id="par_idN105D3" role="bascode" xml-lang="en-US"> sSng=Single ' sSng is an implicit single variable</paragraph> -<paragraph id="par_idm1341230096" role="bascode" localize="false" xml-lang="en-US">End Sub</paragraph> + <paragraph id="par_idm1341232592" role="bascode" localize="false">Sub ExampleDefSng</paragraph> + <paragraph id="par_idN105D3" role="bascode" xml-lang="en-US"> wSng=Single ' wSng is an implicit single variable</paragraph> + <paragraph id="par_idN105D4" role="bascode" xml-lang="en-US"> Print afloat, Typename(Word), VarType(anyNum) ' Result is : 0 single 4</paragraph> + <paragraph id="par_idm1341230096" role="bascode" localize="false">End Sub</paragraph> </bascode> </body> diff --git a/source/text/sbasic/shared/03101140.xhp b/source/text/sbasic/shared/03101140.xhp index f9847edbd7..22be17bbe3 100644 --- a/source/text/sbasic/shared/03101140.xhp +++ b/source/text/sbasic/shared/03101140.xhp @@ -32,19 +32,19 @@ <bookmark_value>DefStr statement</bookmark_value> </bookmark> -<paragraph id="par_idN10577" role="heading" level="1" xml-lang="en-US"><link href="text/sbasic/shared/03101140.xhp">DefStr Statement</link></paragraph> +<h1 id="par_idN10577"><link href="text/sbasic/shared/03101140.xhp">DefStr Statement</link></h1> <paragraph id="par_idN10587" role="paragraph" xml-lang="en-US">If no type-declaration character or keyword is specified, the DefStr statement sets the default variable type, according to a letter range.</paragraph> </section> <embed href="text/sbasic/shared/03101100.xhp#PrefixDefCommon"/> -<paragraph id="par_idN105AA" role="paragraph" xml-lang="en-US"> <emph>DefStr:</emph> String</paragraph> <embed href="text/sbasic/shared/03101100.xhp#ExamplePrefixDefCommon"/> + <bascode> -<paragraph id="par_idm1340827920" role="bascode" localize="false" xml-lang="en-US">DefStr s</paragraph> -<paragraph id="par_idm1340826688" role="bascode" localize="false" xml-lang="en-US">Sub ExampleDefStr</paragraph> -<paragraph id="par_idN105D3" role="bascode" xml-lang="en-US"> sStr=String ' sStr is an implicit string variable</paragraph> -<paragraph id="par_idm1341620336" role="bascode" localize="false" xml-lang="en-US">End Sub</paragraph> + <paragraph id="par_idm1340826688" role="bascode" localize="false" xml-lang="en-US">Sub ExampleDefStr</paragraph> + <paragraph id="par_idN105D3" role="bascode" xml-lang="en-US"> sStr=String ' sStr is an implicit string variable</paragraph> + <paragraph id="par_idN105D4" role="bascode" xml-lang="en-US"> Print VarType(slice), strng, TypeName(sheet) ' Result is: 8 "" String</paragraph> + <paragraph id="par_idm1341620336" role="bascode" localize="false" xml-lang="en-US">End Sub</paragraph> </bascode> </body> diff --git a/source/text/sbasic/shared/03101300.xhp b/source/text/sbasic/shared/03101300.xhp index 8dec758eb9..6c84e65636 100644 --- a/source/text/sbasic/shared/03101300.xhp +++ b/source/text/sbasic/shared/03101300.xhp @@ -32,19 +32,19 @@ <bookmark_value>DefDate statement</bookmark_value> </bookmark> -<paragraph id="hd_id3150504" role="heading" level="1" xml-lang="en-US"><link href="text/sbasic/shared/03101300.xhp" name="DefDate Statement">DefDate Statement</link></paragraph> +<h1 id="hd_id3150504"><link href="text/sbasic/shared/03101300.xhp" name="DefDate Statement">DefDate Statement</link></h1> <paragraph id="par_id3145069" role="paragraph" xml-lang="en-US">If no type-declaration character or keyword is specified, the DefDate statement sets the default variable type, according to a letter range.</paragraph> </section> <embed href="text/sbasic/shared/03101100.xhp#PrefixDefCommon"/> -<paragraph id="par_id3150767" role="paragraph" xml-lang="en-US"> <emph>DefDate:</emph> Date</paragraph> <embed href="text/sbasic/shared/03101100.xhp#ExamplePrefixDefCommon"/> <bascode> -<paragraph id="par_idm1341297408" role="bascode" localize="false" xml-lang="en-US">Sub ExampleDefDate</paragraph> -<paragraph id="par_id3152462" role="bascode" xml-lang="en-US"> tDate=Date ' tDate is an implicit date variable</paragraph> -<paragraph id="par_idm1341619984" role="bascode" localize="false" xml-lang="en-US">End Sub</paragraph> + <paragraph id="par_idm1341297408" role="bascode" localize="false">Sub ExampleDefDate</paragraph> + <paragraph id="par_id3152462" role="bascode" xml-lang="en-US"> tDate=Date ' tDate is an implicit date variable</paragraph> + <paragraph id="par_id3153562" role="bascode" xml-lang="en-US"> Print VarType(tea), train, TypeName(timedate), IsDate(tick) ' Displays: 7 00:00:00 Date True</paragraph> + <paragraph id="par_idm1341619984" role="bascode" localize="false">End Sub</paragraph> </bascode> -</body> +</body> </helpdocument> diff --git a/source/text/sbasic/shared/03101400.xhp b/source/text/sbasic/shared/03101400.xhp index 1522dd01b0..ee96efa7ac 100644 --- a/source/text/sbasic/shared/03101400.xhp +++ b/source/text/sbasic/shared/03101400.xhp @@ -32,18 +32,18 @@ <bookmark_value>DefDbl statement</bookmark_value> </bookmark> -<paragraph id="hd_id3147242" role="heading" level="1" xml-lang="en-US"><link href="text/sbasic/shared/03101400.xhp" name="DefDbl Statement">DefDbl Statement</link></paragraph> +<h1 id="hd_id3147242"><link href="text/sbasic/shared/03101400.xhp" name="DefDbl Statement">DefDbl Statement</link></h1> <paragraph id="par_id3153126" role="paragraph" xml-lang="en-US">Sets the default variable type, according to a letter range, if no type-declaration character or keyword is specified.</paragraph> </section> <embed href="text/sbasic/shared/03101100.xhp#PrefixDefCommon"/> -<paragraph id="par_id3154123" role="paragraph" xml-lang="en-US"> <emph>DefDbl:</emph> Double</paragraph> <embed href="text/sbasic/shared/03101100.xhp#ExamplePrefixDefCommon"/> <bascode> -<paragraph id="par_idm1341565856" role="bascode" localize="false" xml-lang="en-US">Sub ExampleDefDBL</paragraph> -<paragraph id="par_id3153144" role="bascode" xml-lang="en-US"> dValue=1.23e43 ' dValue is an implicit double variable type</paragraph> -<paragraph id="par_idm1341562864" role="bascode" localize="false" xml-lang="en-US">End Sub</paragraph> + <paragraph id="par_idm1341565856" role="bascode" localize="false" xml-lang="en-US">Sub ExampleDefDBL</paragraph> + <paragraph id="par_id3154244" role="bascode" xml-lang="en-US"> fValue=1.23e43 ' fValue is an implicit double variable type</paragraph> + <paragraph id="par_id3153144" role="bascode" xml-lang="en-US"> Print Typename(float), VarType(fire), factory ' Result is: Double 5 0</paragraph> + <paragraph id="par_idm1341562864" role="bascode" localize="false" xml-lang="en-US">End Sub</paragraph> </bascode> </body> diff --git a/source/text/sbasic/shared/03101500.xhp b/source/text/sbasic/shared/03101500.xhp index 96e1cc57ab..2a371295b9 100644 --- a/source/text/sbasic/shared/03101500.xhp +++ b/source/text/sbasic/shared/03101500.xhp @@ -32,18 +32,18 @@ <bookmark_value>DefInt statement</bookmark_value> </bookmark> -<paragraph id="hd_id3149811" role="heading" level="1" xml-lang="en-US"><link href="text/sbasic/shared/03101500.xhp" name="DefInt Statement">DefInt Statement</link></paragraph> +<h1 id="hd_id3149811"><link href="text/sbasic/shared/03101500.xhp" name="DefInt Statement">DefInt Statement</link></h1> <paragraph id="par_id3149762" role="paragraph" xml-lang="en-US">Sets the default variable type, according to a letter range, if no type-declaration character or keyword is specified.</paragraph> </section> <embed href="text/sbasic/shared/03101100.xhp#PrefixDefCommon"/> -<paragraph id="par_id3125863" role="paragraph" xml-lang="en-US"> <emph>DefInt:</emph> Integer</paragraph> <embed href="text/sbasic/shared/03101100.xhp#ExamplePrefixDefCommon"/> <bascode> -<paragraph id="par_idm1341564528" role="bascode" localize="false" xml-lang="en-US">Sub ExampleDefInt</paragraph> -<paragraph id="par_id3153728" role="bascode" xml-lang="en-US"> iCount=200 ' iCount is an implicit integer variable</paragraph> -<paragraph id="par_idm1341561552" role="bascode" localize="false" xml-lang="en-US">End Sub</paragraph> + <paragraph id="par_idm1341564528" role="bascode" localize="false" xml-lang="en-US">Sub ExampleDefInt</paragraph> + <paragraph id="par_id3164728" role="bascode" xml-lang="en-US"> iCount=200 ' iCount is an implicit integer variable</paragraph> + <paragraph id="par_id3153728" role="bascode" xml-lang="en-US"> Print kilos, Typename(number), VarType(Java) ' Result is: 0 Integer 2</paragraph> + <paragraph id="par_idm1341561552" role="bascode" localize="false" xml-lang="en-US">End Sub</paragraph> </bascode> </body> diff --git a/source/text/sbasic/shared/03101600.xhp b/source/text/sbasic/shared/03101600.xhp index c354d16381..f872bcdf05 100644 --- a/source/text/sbasic/shared/03101600.xhp +++ b/source/text/sbasic/shared/03101600.xhp @@ -32,18 +32,18 @@ <bookmark_value>DefLng statement</bookmark_value> </bookmark> -<paragraph id="hd_id3148538" role="heading" level="1" xml-lang="en-US"><link href="text/sbasic/shared/03101600.xhp" name="DefLng Statement">DefLng Statement</link></paragraph> -<paragraph id="par_id3149514" role="paragraph" xml-lang="en-US">Sets the default variable type, according to a letter range, if no type-declaration character or keyword is specified.</paragraph> +<h1 id="hd_id3148538" ><link href="text/sbasic/shared/03101600.xhp" name="DefLng Statement">DefLng Statement</link></h1> +<paragraph id="par_id3149514" role="paragraph">Sets the default variable type, according to a letter range, if no type-declaration character or keyword is specified.</paragraph> </section> <embed href="text/sbasic/shared/03101100.xhp#PrefixDefCommon"/> -<paragraph id="par_id3154686" role="paragraph" xml-lang="en-US"> <emph>DefLng:</emph> Long</paragraph> <embed href="text/sbasic/shared/03101100.xhp#ExamplePrefixDefCommon"/> <bascode> -<paragraph id="par_idm871792224" role="bascode" localize="false" xml-lang="en-US">Sub ExampleDefLng</paragraph> -<paragraph id="par_id3145273" role="bascode" xml-lang="en-US"> lCount=123456789 ' lCount is an implicit long integer variable</paragraph> -<paragraph id="par_idm871789232" role="bascode" localize="false" xml-lang="en-US">End Sub</paragraph> + <paragraph id="par_idm871792224" role="bascode" localize="false">Sub ExampleDefLng</paragraph> + <paragraph id="par_id3145273" role="bascode" xml-lang="en-US"> xCount=123456789 ' xCount is an implicit long integer variable</paragraph> + <paragraph id="par_id3255273" role="bascode" xml-lang="en-US"> Print VarType(Yes), zinc, Typename(Max) ' Result is: 3 0 Long</paragraph> + <paragraph id="par_idm871789232" role="bascode" localize="false">End Sub</paragraph> </bascode> </body> diff --git a/source/text/sbasic/shared/03101700.xhp b/source/text/sbasic/shared/03101700.xhp index 42b09fc9f9..db099499cc 100644 --- a/source/text/sbasic/shared/03101700.xhp +++ b/source/text/sbasic/shared/03101700.xhp @@ -32,14 +32,18 @@ <section id="defobj"> <bookmark xml-lang="en-US" branch="index" id="bm_id3149811"><bookmark_value>DefObj statement</bookmark_value> </bookmark> -<paragraph role="heading" id="hd_id3149811" xml-lang="en-US" level="1"><link href="text/sbasic/shared/03101700.xhp" name="DefObj Statement">DefObj Statement</link></paragraph> +<h1 id="hd_id3149811"><link href="text/sbasic/shared/03101700.xhp" name="DefObj Statement">DefObj Statement</link></h1> <paragraph role="paragraph" id="par_id3147573" xml-lang="en-US">Sets the default variable type, according to a letter range, if no type-declaration character or keyword is specified.</paragraph> </section> <embed href="text/sbasic/shared/03101100.xhp#PrefixDefCommon"/> -<paragraph role="paragraph" id="par_id3150769" xml-lang="en-US"> -<emph>DefObj:</emph> Object</paragraph> <embed href="text/sbasic/shared/03101100.xhp#ExamplePrefixDefCommon"/> +<bascode> + <paragraph id="par_idm871792224" role="bascode" localize="false">Sub DefObj_example</paragraph> + <paragraph id="par_id3255273" role="bascode" xml-lang="en-US"> Print Typename(properties), VarType(ordinal), IsNull(unique), IsObject(org)' Result is: Object 9 True False</paragraph> + <paragraph id="par_idm871789232" role="bascode" localize="false">End Sub</paragraph> +</bascode> + </body> </helpdocument> diff --git a/source/text/sbasic/shared/03102000.xhp b/source/text/sbasic/shared/03102000.xhp index 767a31950a..422b417cf2 100644 --- a/source/text/sbasic/shared/03102000.xhp +++ b/source/text/sbasic/shared/03102000.xhp @@ -27,42 +27,24 @@ <body> - <section id="defvar"> <bookmark xml-lang="en-US" branch="index" id="bm_id3143267"> <bookmark_value>DefVar statement</bookmark_value> </bookmark> - -<paragraph id="hd_id3143267" role="heading" level="1" xml-lang="en-US"><link href="text/sbasic/shared/03102000.xhp" name="DefVar Statement">DefVar Statement</link></paragraph> +<h1 id="hd_id3143267"><link href="text/sbasic/shared/03102000.xhp" name="DefVar Statement">DefVar Statement</link></h1> <paragraph id="par_id3153825" role="paragraph" xml-lang="en-US">Sets the default variable type, according to a letter range, if no type-declaration character or keyword is specified.</paragraph> </section> -<paragraph id="hd_id3154143" role="heading" level="2" xml-lang="en-US">Syntax:</paragraph> -<bascode> -<paragraph id="par_id3149514" role="bascode" xml-lang="en-US">Defxxx Characterrange1[, Characterrange2[,...]]</paragraph> -</bascode> - -<paragraph id="hd_id3156024" role="heading" level="2" xml-lang="en-US">Parameters:</paragraph> -<paragraph id="par_id3147560" role="paragraph" xml-lang="en-US"> <emph>Characterrange:</emph> Letters that specify the range of variables that you want to set the default data type for.</paragraph> -<paragraph id="par_id3148552" role="paragraph" xml-lang="en-US"> <emph>xxx:</emph> Keyword that defines the default variable type:</paragraph> -<paragraph id="par_id3153524" role="paragraph" xml-lang="en-US"> <emph>Keyword: </emph>Default variable type</paragraph> -<paragraph id="par_id3150767" role="paragraph" xml-lang="en-US"> <emph>DefVar:</emph> Variant</paragraph> +<embed href="text/sbasic/shared/03101100.xhp#PrefixDefCommon"/> -<paragraph id="hd_id3151041" role="heading" level="2" xml-lang="en-US">Example:</paragraph> +<embed href="text/sbasic/shared/03101100.xhp#ExamplePrefixDefCommon"/> <bascode> -<paragraph id="par_id3156214" role="bascode" xml-lang="en-US">' Prefix definitions for variable types:</paragraph> -<paragraph id="par_idm1341099344" role="bascode" localize="false" xml-lang="en-US">DefBool b</paragraph> -<paragraph id="par_idm1341098112" role="bascode" localize="false" xml-lang="en-US">DefDate t</paragraph> -<paragraph id="par_idm1341096880" role="bascode" localize="false" xml-lang="en-US">DefDbl d</paragraph> -<paragraph id="par_idm1341095648" role="bascode" localize="false" xml-lang="en-US">DefInt i</paragraph> -<paragraph id="par_idm1341094416" role="bascode" localize="false" xml-lang="en-US">DefLng l</paragraph> -<paragraph id="par_idm1341093184" role="bascode" localize="false" xml-lang="en-US">DefObj o</paragraph> -<paragraph id="par_idm1341091952" role="bascode" localize="false" xml-lang="en-US">DefVar v</paragraph> -<paragraph id="par_idm1341090720" role="bascode" localize="false" xml-lang="en-US">Sub ExampleDefVar</paragraph> -<paragraph id="par_id3154012" role="bascode" xml-lang="en-US"> vDiv=99 ' vDiv is an implicit variant</paragraph> -<paragraph id="par_id3146121" role="bascode" xml-lang="en-US"> vDiv="Hello world"</paragraph> -<paragraph id="par_idm1341086032" role="bascode" localize="false" xml-lang="en-US">End Sub</paragraph> + <paragraph id="par_idm1341090720" role="bascode" localize="false" xml-lang="en-US">Sub ExampleDefVar</paragraph> + <paragraph id="par_id3154012" role="bascode" xml-lang="en-US"> vDiv=99 ' vDiv is an implicit variant</paragraph> + <paragraph id="par_id3146121" role="bascode" xml-lang="en-US"> values="Hello world"</paragraph> + <paragraph id="par_id3147221" role="bascode" xml-lang="en-US"> Print Typename(glob), VarType(values), IsEmpty(ergo_sum) ' Displays: Empty 8 True</paragraph> + <paragraph id="par_idm1341086032" role="bascode" localize="false" xml-lang="en-US">End Sub</paragraph> </bascode> </body> |