CONFIG BASE/de

From MCS Wiki AVR
< CONFIG BASE
Revision as of 21:03, 7 February 2013 by Admin (Talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Contents

= (**COPIED FROM ENGLISH PAGE**) === Action

This option specifies the lower boundary of all arrays.

 

 

Syntax

CONFIG BASE= value

 

 

Remarks

By default the first element of an array starts at 1. With CONFIG BASE=0 you can override this default so that all arrays start at 0.

In some cases it is simpler that elements start at 0.

A constant named _BASE reflects the setting. You can not change the BASE at run time.

 

Notice.jpg
When you change this setting in existing code, you need to alter your code. For example when you used this code:

Dim a(10) as byte : a(10) = 10

And you set CONFIG BASE=0, it will mean that element 10 is invalid.

 

While in QB an additional element is created, this is not a good idea in bascom because it will require more space.

 

 

See also

NONE

 

 

Example


CONFIG BASE=0
Dim ar(10) as byte , j as byte
For j=0 to 9
 ar(j)=j
Next

Languages   English Deutsch  
Personal tools
Namespaces
Variants
Actions
Navigation
In other languages
Language