diff options
Diffstat (limited to 'source/text/sbasic/shared/01020100.xhp')
-rw-r--r-- | source/text/sbasic/shared/01020100.xhp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/source/text/sbasic/shared/01020100.xhp b/source/text/sbasic/shared/01020100.xhp index 64cdb0a4ce..6b01d6ef3a 100644 --- a/source/text/sbasic/shared/01020100.xhp +++ b/source/text/sbasic/shared/01020100.xhp @@ -43,7 +43,7 @@ </bookmark> -<h1 id="hd_id3149346"><link href="text/sbasic/shared/01020100.xhp" name="Using Variables">Using Variables</link></h1> +<h1 id="hd_id3149346"><link href="text/sbasic/shared/01020100.xhp">Using Variables</link></h1> <paragraph id="par_id3154346" role="paragraph" xml-lang="en-US">The following describes the basic use of variables in $[officename] Basic.</paragraph> </section> @@ -84,7 +84,7 @@ <paragraph role="bascode" id="bas_id161619555482237">' A variable can also be explicitly declared as a Variant</paragraph> <paragraph role="bascode" localize="false" id="bas_id601619552527089">Dim e As Variant, f As Double</paragraph> </bascode> -<note id="par_id521619551687371">The <emph>Variant</emph> type is a special data type that can store any kind of value. To learn more, refer to the section <link href="text/sbasic/shared/01020100.xhp#VariantTypeH2" name="Variant Type">The Variant type</link> below.</note> +<note id="par_id521619551687371">The <emph>Variant</emph> type is a special data type that can store any kind of value. To learn more, refer to the section <link href="text/sbasic/shared/01020100.xhp#VariantTypeH2">The Variant type</link> below.</note> <h3 id="hd_id3149331">Forcing Variable Declarations</h3> <paragraph id="par_id3149443" role="paragraph" xml-lang="en-US">To force declaration of variables, use the following command:</paragraph> @@ -176,7 +176,7 @@ </bascode> <h3 id="hd_id3149722">Date Variables</h3> -<paragraph id="par_id3159116" role="paragraph" xml-lang="en-US">Date variables can only contain dates and time values stored in an internal format. Values assigned to Date variables with <link href="text/sbasic/shared/03030101.xhp" name="Dateserial"><emph>Dateserial</emph></link>, <link href="text/sbasic/shared/03030102.xhp" name="Datevalue"><emph>Datevalue</emph></link>, <link href="text/sbasic/shared/03030205.xhp" name="Timeserial"><emph>Timeserial</emph></link> or <link href="text/sbasic/shared/03030206.xhp" name="Timevalue"><emph>Timevalue</emph></link> are automatically converted to the internal format. Date-variables are converted to normal numbers by using the <link href="text/sbasic/shared/03030103.xhp" name="Day"><emph>Day</emph></link>, <link href="text/sbasic/shared/03030104.xhp" name="Month"><emph>Month</emph></link>, <link href="text/sbasic/shared/03030106.xhp" name="Year"><emph>Year</emph></link> or the <link href="text/sbasic/shared/03030201.xhp" name="Hour"><emph>Hour</emph></link>, <link href="text/sbasic/shared/03030202.xhp" name="Minute"><emph>Minute</emph></link>, <link href="text/sbasic/shared/03030204.xhp" name="Second"><emph>Second</emph></link> function. The internal format enables a comparison of date/time values by calculating the difference between two numbers. These variables can only be declared with the key word <emph>Date</emph>.</paragraph> +<paragraph id="par_id3159116" role="paragraph" xml-lang="en-US">Date variables can only contain dates and time values stored in an internal format. Values assigned to Date variables with <link href="text/sbasic/shared/03030101.xhp"><emph>Dateserial</emph></link>, <link href="text/sbasic/shared/03030102.xhp"><emph>Datevalue</emph></link>, <link href="text/sbasic/shared/03030205.xhp"><emph>Timeserial</emph></link> or <link href="text/sbasic/shared/03030206.xhp"><emph>Timevalue</emph></link> are automatically converted to the internal format. Date-variables are converted to normal numbers by using the <link href="text/sbasic/shared/03030103.xhp"><emph>Day</emph></link>, <link href="text/sbasic/shared/03030104.xhp"><emph>Month</emph></link>, <link href="text/sbasic/shared/03030106.xhp"><emph>Year</emph></link> or the <link href="text/sbasic/shared/03030201.xhp"><emph>Hour</emph></link>, <link href="text/sbasic/shared/03030202.xhp"><emph>Minute</emph></link>, <link href="text/sbasic/shared/03030204.xhp"><emph>Second</emph></link> function. The internal format enables a comparison of date/time values by calculating the difference between two numbers. These variables can only be declared with the key word <emph>Date</emph>.</paragraph> <bascode> <paragraph id="par_idm1341092144" role="bascode" localize="false" xml-lang="en-US">Dim Variable As Date</paragraph> </bascode> @@ -217,7 +217,7 @@ <paragraph role="bascode" id="bas_id181619554965451">Dim varB as Variant ' The variable is explicitly declared as a Variant</paragraph> <paragraph role="bascode" id="bas_id371619554853094">varC = "abc" ' Previously undeclared variables are treated as Variants</paragraph> </bascode> -<paragraph role="paragraph" id="par_id631619552417343">The example below uses the <link href="text/sbasic/shared/03103600.xhp" name="TypeName function">TypeName function</link> to show how the type of a <emph>Variant</emph> variable changes upon assignment.</paragraph> +<paragraph role="paragraph" id="par_id631619552417343">The example below uses the <link href="text/sbasic/shared/03103600.xhp">TypeName function</link> to show how the type of a <emph>Variant</emph> variable changes upon assignment.</paragraph> <bascode> <paragraph role="bascode" localize="false" id="bas_id221619552494450">Dim myVar As Variant</paragraph> <paragraph role="bascode" localize="false" id="bas_id221619553194424">MsgBox TypeName(myVar) ' Empty</paragraph> @@ -226,7 +226,7 @@ <paragraph role="bascode" localize="false" id="bas_id731619553195384">myVar = 10</paragraph> <paragraph role="bascode" localize="false" id="bas_id211619553195648">MsgBox TypeName(myVar) ' Integer</paragraph> </bascode> -<note id="par_id141619553442668">A <emph>Variant</emph> variable is initialized with the <link href="text/sbasic/shared/03040000.xhp#objectconstants" name=" object constants">Empty</link> special data type. You can use the <link href="text/sbasic/shared/03102400.xhp" name="IsEmpty function">IsEmpty function</link> to test if a variable is an <emph>Empty Variant</emph>.</note> +<note id="par_id141619553442668">A <emph>Variant</emph> variable is initialized with the <link href="text/sbasic/shared/03040000.xhp#objectconstants">Empty</link> special data type. You can use the <link href="text/sbasic/shared/03102400.xhp">IsEmpty function</link> to test if a variable is an <emph>Empty Variant</emph>.</note> <paragraph role="paragraph" id="par_id541619552755706">You can also use the keyword <emph>Any</emph> to declare a variable as a <emph>Variant</emph>. However, <emph>Any</emph> is deprecated and is available for backward compatibility.</paragraph> <warning id="par_id711619622934043">Arguments with type <emph>Variant</emph> or <emph>Any</emph> passed in function calls are not checked for their types.</warning> <bascode> @@ -236,7 +236,7 @@ <h2 id="hd_id3148732">Initial Variable Values</h2> <paragraph id="par_id3154549" role="paragraph" xml-lang="en-US">As soon as the variable has been declared, it is automatically set to the "Null" value. Note the following conventions:</paragraph> <paragraph id="par_id3143222" role="paragraph" xml-lang="en-US"> <emph>Numeric</emph> variables are automatically assigned the value "0" as soon as they are declared.</paragraph> -<paragraph id="par_id3150693" role="paragraph" xml-lang="en-US"> <emph>Date variables</emph> are assigned the value 0 internally; equivalent to converting the value to "0" with the <link href="text/sbasic/shared/03030103.xhp" name="Day"><emph>Day</emph></link>, <link href="text/sbasic/shared/03030104.xhp" name="Month"><emph>Month</emph></link>, <link href="text/sbasic/shared/03030106.xhp" name="Year"><emph>Year</emph></link> or the <link href="text/sbasic/shared/03030201.xhp" name="Hour"><emph>Hour</emph></link>, <link href="text/sbasic/shared/03030202.xhp" name="Minute"><emph>Minute</emph></link>, <link href="text/sbasic/shared/03030204.xhp" name="Second"><emph>Second</emph></link> function.</paragraph> +<paragraph id="par_id3150693" role="paragraph" xml-lang="en-US"> <emph>Date variables</emph> are assigned the value 0 internally; equivalent to converting the value to "0" with the <link href="text/sbasic/shared/03030103.xhp"><emph>Day</emph></link>, <link href="text/sbasic/shared/03030104.xhp"><emph>Month</emph></link>, <link href="text/sbasic/shared/03030106.xhp"><emph>Year</emph></link> or the <link href="text/sbasic/shared/03030201.xhp"><emph>Hour</emph></link>, <link href="text/sbasic/shared/03030202.xhp"><emph>Minute</emph></link>, <link href="text/sbasic/shared/03030204.xhp"><emph>Second</emph></link> function.</paragraph> <paragraph id="par_id3154807" role="paragraph" xml-lang="en-US"> <emph>String variables</emph> are assigned an empty-string ("") when they are declared.</paragraph> <h2 id="hd_id3153936">Arrays</h2> |