Array

From Lazarus wiki
Revision as of 12:13, 5 January 2007 by Onr (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigationJump to search

n array is a group of variables of the same kind (may be an array of char, integer, real or anithing else) for voriables of different types you have to use structures.

the declaration works as for the simple variables adding number & gender the simplest way is as follows: program ... begin var: a,b:array [x..y]of byte The array is in mathematics a vector it contains a number (defined before;)) of variables. you can also have multidimensional array so (x..y,z..t) and so on... to call a variable you have to put the name of the array and the position a[1..3] and you can use it as a simple variable, but if you want to use parameters you MUST use a structure because else it will cause errors or bugs...