{{htmlmetatags>metatag-robots=()
metatag-title=(ARRAY | ugBASIC User Manual)
metatag-keywords=(ugBASIC,Commodore 64,Commodore PLUS/4,ZX Spectrum)
metatag-description=(Manual page for ARRAY)
metatag-media-og:image=(:ugbasic:logo-ugbasic-fb.png)
metatag-og:title=(ARRAY | ugBASIC User Manual)
metatag-og:description=(Manual page for ARRAY)
}}
====== ugBASIC User Manual ======
===== ARRAY =====
===== SYNTAX =====
ARRAY var = ...
ARRAY var := ...
==== PURPOSE ====
The ''ARRAY'' keyword allows you to copy a block of memory from a static definition
to an array at run time. In simple terms, it copies an array of bytes from the right
expression to a ''var''. It is especially useful when you want to initialize an
array with a specific value or assign an entire array.
This method is generally faster than copying element by element,
especially for large arrays. It provides a concise way to initialize an entire
array with a constant value.
If you want to initialize an array to a single byte, memset is more efficient.
For small arrays or when initializing elements with different values, direct
assignment can be more readable.
==== EXAMPLE ====
DIM var(4) AS BYTE
ARRAY var = #{42424242}
==== ABBREVIATION ====
Ar
==== AVAILABLE ON ====
==== ANY PROBLEM? ====
If you have encountered a problem using this command, if you think there is a bug or the explanation is unclear, please [[https://github.com/spotlessmind1975/ugbasic/issues/new?title=ISSUE ON ARRAY|open an issue]] for this keyword on GitHub. Thank you!===== POWERED BY =====
[[:ugbasic:user:index|{{ :ugbasic:user:logo-ugbasic.png?nolink&600 |}}]]