1<?xml version="1.0" encoding="UTF-8"?>
2
3
4
5<!--
6 ***********************************************************************
7 *
8 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
9 *
10 * Copyright 2000, 2010 Oracle and/or its affiliates.
11 *
12 * OpenOffice.org - a multi-platform office productivity suite
13 *
14 * This file is part of OpenOffice.org.
15 *
16 * OpenOffice.org is free software: you can redistribute it and/or modify
17 * it under the terms of the GNU Lesser General Public License version 3
18 * only, as published by the Free Software Foundation.
19 *
20 * OpenOffice.org is distributed in the hope that it will be useful,
21 * but WITHOUT ANY WARRANTY; without even the implied warranty of
22 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
23 * GNU Lesser General Public License version 3 for more details
24 * (a copy is included in the LICENSE file that accompanied this code).
25 *
26 * You should have received a copy of the GNU Lesser General Public License
27 * version 3 along with OpenOffice.org.  If not, see
28 * <http://www.openoffice.org/license.html>
29 * for a copy of the LGPLv3 License.
30 *
31 ************************************************************************
32 -->
33
34
35		<helpdocument version="1.0">
36<meta>
37<topic id="textsbasicshared01020100xml" indexer="include" status="PUBLISH">
38<title id="tit" xml-lang="en-US">Using Variables</title>
39<filename>/text/sbasic/shared/01020100.xhp</filename>
40</topic>
41</meta>
42<body>
43<section id="variable">
44<bookmark xml-lang="en-US" branch="index" id="bm_id3149346"><bookmark_value>names of variables</bookmark_value>
45<bookmark_value>variables; using</bookmark_value>
46<bookmark_value>types of variables</bookmark_value>
47<bookmark_value>declaring variables</bookmark_value>
48<bookmark_value>values;of variables</bookmark_value>
49<bookmark_value>constants</bookmark_value>
50<bookmark_value>arrays;declaring</bookmark_value>
51<bookmark_value>defining;constants</bookmark_value>
52</bookmark>
53<paragraph role="heading" id="hd_id3149346" xml-lang="en-US" level="1" l10n="U" oldref="1"><link href="text/sbasic/shared/01020100.xhp" name="Using Variables">Using Variables</link></paragraph>
54<paragraph role="paragraph" id="par_id3154346" xml-lang="en-US" l10n="U" oldref="3">The following describes the basic use of variables in $[officename] Basic.</paragraph>
55</section>
56<paragraph role="heading" id="hd_id3153361" xml-lang="en-US" level="2" l10n="U" oldref="4">Naming Conventions for Variable Identifiers</paragraph>
57<paragraph role="paragraph" id="par_id3148797" xml-lang="en-US" l10n="U" oldref="5">A variable name can consist of a maximum of 255 characters. The first character of a variable name <emph>must</emph> be a letter A-Z or a-z. Numbers can also be used in a variable name, but punctuation symbols and special characters are not permitted, with exception of the underscore character ("_"). In $[officename] Basic variable identifiers are not case-sensitive. Variable names may contain spaces but must be enclosed in square brackets if they do.</paragraph>
58<paragraph role="paragraph" id="par_id3156422" xml-lang="en-US" l10n="U" oldref="6">Examples for variable identifiers:</paragraph>
59<table id="tbl_id3154685">
60<tablerow>
61<tablecell colspan="" rowspan="">
62<paragraph role="code" id="par_id3163798" xml-lang="en-US" l10n="U" oldref="7">MyNumber=5</paragraph>
63</tablecell>
64<tablecell colspan="" rowspan="">
65<paragraph role="paragraph" id="par_id3156441" xml-lang="en-US" l10n="U" oldref="126">Correct</paragraph>
66</tablecell>
67</tablerow>
68<tablerow>
69<tablecell colspan="" rowspan="">
70<paragraph role="code" id="par_id3147317" xml-lang="en-US" l10n="U" oldref="8">MyNumber5=15</paragraph>
71</tablecell>
72<tablecell colspan="" rowspan="">
73<paragraph role="paragraph" id="par_id3149664" xml-lang="en-US" l10n="U" oldref="127">Correct</paragraph>
74</tablecell>
75</tablerow>
76<tablerow>
77<tablecell colspan="" rowspan="">
78<paragraph role="code" id="par_id3145364" xml-lang="en-US" l10n="U" oldref="9">MyNumber_5=20</paragraph>
79</tablecell>
80<tablecell colspan="" rowspan="">
81<paragraph role="paragraph" id="par_id3146119" xml-lang="en-US" l10n="U" oldref="128">Correct</paragraph>
82</tablecell>
83</tablerow>
84<tablerow>
85<tablecell colspan="" rowspan="">
86<paragraph role="code" id="par_id3154729" xml-lang="en-US" l10n="U" oldref="10">My Number=20</paragraph>
87</tablecell>
88<tablecell colspan="" rowspan="">
89<paragraph role="paragraph" id="par_id3153876" xml-lang="en-US" l10n="U" oldref="11">Not valid, variable with space must be enclosed in square brackets</paragraph>
90</tablecell>
91</tablerow>
92<tablerow>
93<tablecell colspan="" rowspan="">
94<paragraph role="code" id="par_id3147126" xml-lang="en-US" l10n="U" oldref="14">[My Number]=12</paragraph>
95</tablecell>
96<tablecell colspan="" rowspan="">
97<paragraph role="paragraph" id="par_id3154510" xml-lang="en-US" l10n="U" oldref="15">Correct</paragraph>
98</tablecell>
99</tablerow>
100<tablerow>
101<tablecell colspan="" rowspan="">
102<paragraph role="code" id="par_id3153708" xml-lang="en-US" l10n="U" oldref="12">DéjàVu=25</paragraph>
103</tablecell>
104<tablecell colspan="" rowspan="">
105<paragraph role="paragraph" id="par_id3150330" xml-lang="en-US" l10n="U" oldref="129">Not valid, special characters are not allowed</paragraph>
106</tablecell>
107</tablerow>
108<tablerow>
109<tablecell colspan="" rowspan="">
110<paragraph role="code" id="par_id3155443" xml-lang="en-US" l10n="U" oldref="13">5MyNumber=12</paragraph>
111</tablecell>
112<tablecell colspan="" rowspan="">
113<paragraph role="paragraph" id="par_id3154254" xml-lang="en-US" l10n="U" oldref="130">Not valid, variable may not begin with a number</paragraph>
114</tablecell>
115</tablerow>
116<tablerow>
117<tablecell colspan="" rowspan="">
118<paragraph role="code" id="par_id3147345" xml-lang="en-US" l10n="U" oldref="16">Number,Mine=12</paragraph>
119</tablecell>
120<tablecell colspan="" rowspan="">
121<paragraph role="paragraph" id="par_id3149256" xml-lang="en-US" l10n="U" oldref="131">Not valid, punctuation marks are not allowed</paragraph>
122</tablecell>
123</tablerow>
124</table>
125<paragraph role="heading" id="hd_id3146317" xml-lang="en-US" level="2" l10n="U" oldref="17">Declaring Variables</paragraph>
126<paragraph role="paragraph" id="par_id3150299" xml-lang="en-US" l10n="U" oldref="18">In $[officename] Basic you don't need to declare variables explicitly. A variable declaration can be performed with the <emph>Dim</emph> statement. You can declare more than one variable at a time by separating the names with a comma. To define the variable type, use either a type-declaration sign after the name, or the appropriate key word. </paragraph>
127<paragraph role="paragraph" id="par_id3154118" xml-lang="en-US" l10n="U" oldref="140">Examples for variable declarations:</paragraph>
128<table id="tbl_id3154658">
129<tablerow>
130<tablecell colspan="" rowspan="">
131<paragraph role="code" id="par_id3150090" xml-lang="en-US" l10n="U" oldref="19">DIM a$</paragraph>
132</tablecell>
133<tablecell colspan="" rowspan="">
134<paragraph role="paragraph" id="par_id3150982" xml-lang="en-US" l10n="U" oldref="132">Declares the variable "a" as a String</paragraph>
135</tablecell>
136</tablerow>
137<tablerow>
138<tablecell colspan="" rowspan="">
139<paragraph role="code" id="par_id3149531" xml-lang="en-US" l10n="U" oldref="20">DIM a As String</paragraph>
140</tablecell>
141<tablecell colspan="" rowspan="">
142<paragraph role="paragraph" id="par_id3150343" xml-lang="en-US" l10n="U" oldref="133">Declares the variable "a" as a String</paragraph>
143</tablecell>
144</tablerow>
145<tablerow>
146<tablecell colspan="" rowspan="">
147<paragraph role="code" id="par_id3149036" xml-lang="en-US" l10n="U" oldref="21">DIM a$, b As Integer</paragraph>
148</tablecell>
149<tablecell colspan="" rowspan="">
150<paragraph role="paragraph" id="par_id3155507" xml-lang="en-US" l10n="U" oldref="22">Declares one variable as a String and one as an Integer</paragraph>
151</tablecell>
152</tablerow>
153<tablerow>
154<tablecell colspan="" rowspan="">
155<paragraph role="code" id="par_idN10854" xml-lang="en-US" l10n="NEW">DIM c As Boolean</paragraph>
156</tablecell>
157<tablecell colspan="" rowspan="">
158<paragraph role="paragraph" id="par_idN10859" xml-lang="en-US" l10n="NEW">Declares c as a Boolean variable that can be TRUE or FALSE</paragraph>
159</tablecell>
160</tablerow>
161</table>
162<paragraph role="paragraph" id="par_id3150519" xml-lang="en-US" l10n="U" oldref="23">It is very important when declaring variables that you use the type-declaration character each time, even if it was used in the declaration instead of a keyword. Thus the following statements are invalid:</paragraph>
163<table id="tbl_id3155529">
164<tablerow>
165<tablecell colspan="" rowspan="">
166<paragraph role="code" id="par_id3152985" xml-lang="en-US" l10n="U" oldref="24">DIM a$</paragraph>
167</tablecell>
168<tablecell colspan="" rowspan="">
169<paragraph role="paragraph" id="par_id3154527" xml-lang="en-US" l10n="U" oldref="134">Declares "a" as a String</paragraph>
170</tablecell>
171</tablerow>
172<tablerow>
173<tablecell colspan="" rowspan="">
174<paragraph role="code" id="par_id3148599" xml-lang="en-US" l10n="U" oldref="25">a="TestString"</paragraph>
175</tablecell>
176<tablecell colspan="" rowspan="">
177<paragraph role="paragraph" id="par_id3153064" xml-lang="en-US" l10n="U" oldref="135">Type-declaration missing: "a$="</paragraph>
178</tablecell>
179</tablerow>
180</table>
181<paragraph role="warning" id="par_id3144770" xml-lang="en-US" l10n="U" oldref="26">Once you have declared a variable as a certain type, you cannot declare the variable under the same name again as a different type!</paragraph>
182<paragraph role="heading" id="hd_id3149331" xml-lang="en-US" level="3" l10n="U" oldref="27">Forcing Variable Declarations</paragraph>
183<paragraph role="paragraph" id="par_id3149443" xml-lang="en-US" l10n="U" oldref="28">To force declaration of variables, use the following command:</paragraph>
184<paragraph role="code" id="par_id3152869" xml-lang="en-US" l10n="U" oldref="29">OPTION EXPLICIT</paragraph>
185<paragraph role="paragraph" id="par_id3155072" xml-lang="en-US" l10n="U" oldref="30">The <emph>Option Explicit</emph> statement has to be the first line in the module, before the first SUB. Generally, only arrays need to be declared explicitly. All other variables are declared according to the type-declaration character, or - if omitted - as the default type <emph>Single</emph>.</paragraph>
186<paragraph role="heading" id="hd_id3154614" xml-lang="en-US" level="2" l10n="U" oldref="34">Variable Types</paragraph>
187<paragraph role="paragraph" id="par_id3155383" xml-lang="en-US" l10n="U" oldref="35">$[officename] Basic supports four variable classes:</paragraph>
188<list type="unordered">
189<listitem>
190<paragraph role="listitem" id="par_id3153972" xml-lang="en-US" l10n="U" oldref="36">
191<emph>Numeric</emph> variables can contain number values. Some variables are used to store large or small numbers, and others are used for floating-point or fractional numbers. </paragraph>
192</listitem>
193<listitem>
194<paragraph role="listitem" id="par_id3159226" xml-lang="en-US" l10n="U" oldref="37">
195<emph>String</emph> variables contain character strings.</paragraph>
196</listitem>
197<listitem>
198<paragraph role="listitem" id="par_id3145217" xml-lang="en-US" l10n="U" oldref="38">
199<emph>Boolean</emph> variables contain either the TRUE or the FALSE value.</paragraph>
200</listitem>
201<listitem>
202<paragraph role="listitem" id="par_id3154762" xml-lang="en-US" l10n="U" oldref="39">
203<emph>Object</emph> variables can store objects of various types, like tables and documents within a document.</paragraph>
204</listitem>
205</list>
206<paragraph role="heading" id="hd_id3153805" xml-lang="en-US" level="3" l10n="U" oldref="40">Integer Variables</paragraph>
207<paragraph role="paragraph" id="par_id3146966" xml-lang="en-US" l10n="U" oldref="41">Integer variables range from -32768 to 32767. If you assign a floating-point value to an integer variable, the decimal places are rounded to the next integer. Integer variables are rapidly calculated in procedures and are suitable for counter variables in loops. An integer variable only requires two bytes of memory. "%" is the type-declaration character.</paragraph>
208<paragraph role="code" id="par_id3153810" xml-lang="en-US" l10n="U" oldref="43">Dim Variable%</paragraph>
209<paragraph role="code" id="par_id3153556" xml-lang="en-US" l10n="U" oldref="44">Dim Variable As Integer</paragraph>
210<paragraph role="heading" id="hd_id3147546" xml-lang="en-US" level="3" l10n="U" oldref="45">Long Integer Variables</paragraph>
211<paragraph role="paragraph" id="par_id3151193" xml-lang="en-US" l10n="U" oldref="46">Long integer variables range from -2147483648 to 2147483647. If you assign a floating-point value to a long integer variable, the decimal places are rounded to the next integer. Long integer variables are rapidly calculated in procedures and are suitable for counter variables in loops for large values. A long integer variable requires four bytes of memory. "&amp;" is the type-declaration character.</paragraph>
212<paragraph role="code" id="par_id3154708" xml-lang="en-US" l10n="U" oldref="48">Dim Variable&amp;</paragraph>
213<paragraph role="code" id="par_id3156365" xml-lang="en-US" l10n="U" oldref="49">Dim Variable as Long</paragraph>
214<paragraph role="heading" id="hd_id7596972" xml-lang="en-US" level="3" l10n="NEW">Decimal Variables<comment>see i64349</comment></paragraph>
215<paragraph role="paragraph" id="par_id2649311" xml-lang="en-US" l10n="NEW">Decimal variables can take positive or negative numbers or zero. Accuracy is up to 29 digits.</paragraph><comment>i85284</comment><paragraph role="paragraph" id="par_id7617114" xml-lang="en-US" l10n="NEW">You can use plus (+) or minus (-) signs as prefixes for decimal numbers (with or without spaces).</paragraph>
216<paragraph role="paragraph" id="par_id1593676" xml-lang="en-US" l10n="NEW">If a decimal number is assigned to an integer variable, %PRODUCTNAME Basic rounds the figure up or down.<comment>this is the only information from "Programming Guide
217for BASIC" about decimal variables</comment></paragraph>
218<paragraph role="heading" id="hd_id3147500" xml-lang="en-US" level="3" l10n="U" oldref="50">Single Variables</paragraph>
219<paragraph role="paragraph" id="par_id3153070" xml-lang="en-US" l10n="U" oldref="51">Single variables can take positive or negative values ranging from 3.402823 x 10E38 to 1.401298 x 10E-45. Single variables are floating-point variables, in which the decimal precision decreases as the non-decimal part of the number increases. Single variables are suitable for mathematical calculations of average precision. Calculations require more time than for Integer variables, but are faster than calculations with Double variables. A Single variable requires 4 bytes of memory. The type-declaration character is "!".</paragraph>
220<paragraph role="code" id="par_id3149875" xml-lang="en-US" l10n="U" oldref="52">Dim Variable!</paragraph>
221<paragraph role="code" id="par_id3153302" xml-lang="en-US" l10n="U" oldref="53">Dim Variable as Single</paragraph>
222<paragraph role="heading" id="hd_id3155753" xml-lang="en-US" level="3" l10n="U" oldref="54">Double Variables</paragraph>
223<paragraph role="paragraph" id="par_id3150953" xml-lang="en-US" l10n="U" oldref="55">Double variables can take positive or negative values ranging from 1.79769313486232 x 10E308 to 4.94065645841247 x 10E-324. Double variables are floating-point variables, in which the decimal precision decreases as the non-decimal part of the number increases. Double variables are suitable for precise calculations. Calculations require more time than for Single variables. A Double variable requires 8 bytes of memory. The type-declaration character is "#".</paragraph>
224<paragraph role="code" id="par_id3150431" xml-lang="en-US" l10n="U" oldref="56">Dim Variable#</paragraph>
225<paragraph role="code" id="par_id3154406" xml-lang="en-US" l10n="U" oldref="57">Dim Variable As Double</paragraph>
226<paragraph role="heading" id="hd_id3155747" xml-lang="en-US" level="3" l10n="U" oldref="95">Currency Variables</paragraph>
227<paragraph role="paragraph" id="par_id3153337" xml-lang="en-US" l10n="U" oldref="96">Currency variables are internally stored as 64-bit numbers (8 Bytes) and displayed as a fixed-decimal number with 15 non-decimal and 4 decimal places. The values range from -922337203685477.5808 to +922337203685477.5807. Currency variables are used to calculate currency values with a high precision. The type-declaration character is "@".</paragraph>
228<paragraph role="code" id="par_id3147296" xml-lang="en-US" l10n="U" oldref="97">Dim Variable@</paragraph>
229<paragraph role="code" id="par_id3150391" xml-lang="en-US" l10n="U" oldref="98">Dim Variable As Currency</paragraph>
230<paragraph role="heading" id="hd_id3148742" xml-lang="en-US" level="3" l10n="U" oldref="58">String Variables</paragraph>
231<paragraph role="paragraph" id="par_id3151393" xml-lang="en-US" l10n="U" oldref="59">String variables can hold character strings with up to 65,535 characters. Each character is stored as the corresponding Unicode value. String variables are suitable for word processing within programs and for temporary storage of any non-printable character up to a maximum length of 64 Kbytes. The memory required for storing string variables depends on the number of characters in the variable. The type-declaration character is "$".</paragraph>
232<paragraph role="code" id="par_id3166467" xml-lang="en-US" l10n="U" oldref="60">Dim Variable$</paragraph>
233<paragraph role="code" id="par_id3153027" xml-lang="en-US" l10n="U" oldref="61">Dim Variable As String</paragraph>
234<paragraph role="heading" id="hd_id3150534" xml-lang="en-US" level="3" l10n="U" oldref="62">Boolean Variables</paragraph>
235<paragraph role="paragraph" id="par_id3145632" xml-lang="en-US" l10n="CHG" oldref="63">Boolean variables store only one of two values: TRUE or FALSE. A number 0 evaluates to FALSE, every other value evaluates to TRUE.</paragraph>
236<paragraph role="code" id="par_id3147615" xml-lang="en-US" l10n="U" oldref="64">Dim Variable As Boolean</paragraph>
237<paragraph role="heading" id="hd_id3149722" xml-lang="en-US" level="3" l10n="U" oldref="65">Date Variables</paragraph>
238<paragraph role="paragraph" id="par_id3159116" xml-lang="en-US" l10n="U" oldref="66">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>
239<paragraph role="code" id="par_id3150462" xml-lang="en-US" l10n="U" oldref="67">Dim Variable As Date</paragraph>
240<paragraph role="heading" id="hd_id3148732" xml-lang="en-US" level="2" l10n="U" oldref="68">Initial Variable Values</paragraph>
241<paragraph role="paragraph" id="par_id3154549" xml-lang="en-US" l10n="U" oldref="69">As soon as the variable has been declared, it is automatically set to the "Null" value. Note the following conventions:</paragraph>
242<paragraph role="paragraph" id="par_id3143222" xml-lang="en-US" l10n="U" oldref="70">
243<emph>Numeric</emph> variables are automatically assigned the value "0" as soon as they are declared.</paragraph>
244<paragraph role="paragraph" id="par_id3150693" xml-lang="en-US" l10n="U" oldref="71">
245<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>
246<paragraph role="paragraph" id="par_id3154807" xml-lang="en-US" l10n="U" oldref="72">
247<emph>String variables</emph> are assigned an empty-string ("") when they are declared.</paragraph>
248<paragraph role="heading" id="hd_id3153936" xml-lang="en-US" level="2" l10n="U" oldref="83">Arrays</paragraph>
249<paragraph role="paragraph" id="par_id3148736" xml-lang="en-US" l10n="U" oldref="84">$[officename] Basic knows one- or multi-dimensional arrays, defined by a specified variable type. Arrays are suitable for editing lists and tables in programs. Individual elements of an array can be addressed through a numeric index.</paragraph>
250<paragraph role="paragraph" id="par_id3149546" xml-lang="en-US" l10n="U" oldref="85">Arrays <emph>must</emph> be declared with the <emph>Dim</emph> statement. There are several ways to define the index range of an array:</paragraph>
251<table id="tbl_id3155829">
252<tablerow>
253<tablecell colspan="" rowspan="">
254<paragraph role="code" id="par_id3150143" xml-lang="en-US" l10n="U" oldref="86">DIM text$(20)</paragraph>
255</tablecell>
256<tablecell colspan="" rowspan="">
257<paragraph role="paragraph" id="par_id3154567" xml-lang="en-US" l10n="U" oldref="136">21 elements numbered from 0 to 20</paragraph>
258</tablecell>
259</tablerow>
260<tablerow>
261<tablecell colspan="" rowspan="">
262<paragraph role="code" id="par_id3145596" xml-lang="en-US" l10n="U" oldref="125">DIM text$(5,4)</paragraph>
263</tablecell>
264<tablecell colspan="" rowspan="">
265<paragraph role="paragraph" id="par_id3154397" xml-lang="en-US" l10n="U" oldref="137">30 elements (a matrix of 6 x 5 elements)</paragraph>
266</tablecell>
267</tablerow>
268<tablerow>
269<tablecell colspan="" rowspan="">
270<paragraph role="code" id="par_id3149185" xml-lang="en-US" l10n="U" oldref="87">DIM text$(5 to 25)</paragraph>
271</tablecell>
272<tablecell colspan="" rowspan="">
273<paragraph role="paragraph" id="par_id3149690" xml-lang="en-US" l10n="U" oldref="138">21 elements numbered from 5 to 25</paragraph>
274</tablecell>
275</tablerow>
276<tablerow>
277<tablecell colspan="" rowspan="">
278<paragraph role="code" id="par_id3155950" xml-lang="en-US" l10n="U" oldref="88">DIM text$(-15 to 5)</paragraph>
279</tablecell>
280<tablecell colspan="" rowspan="">
281<paragraph role="paragraph" id="par_id3153113" xml-lang="en-US" l10n="U" oldref="89">21 elements (including 0), numbered from -15 to 5</paragraph>
282</tablecell>
283</tablerow>
284</table>
285<paragraph role="paragraph" id="par_id3153005" xml-lang="en-US" l10n="CHG" oldref="90">The index range can include positive as well as negative numbers. <comment>UFI: deleted second sentence, #i36558#</comment></paragraph>
286<paragraph role="heading" id="hd_id3154507" xml-lang="en-US" level="2" l10n="U" oldref="91">Constants</paragraph>
287<paragraph role="paragraph" id="par_id3156357" xml-lang="en-US" l10n="U" oldref="92">Constants have a fixed value. They are only defined once in the program and cannot be redefined later:</paragraph>
288<paragraph role="code" id="par_id3153203" xml-lang="en-US" l10n="U" oldref="93">CONST ConstName=Expression</paragraph>
289</body>
290</helpdocument>
291