hello experts,
i need a function that populates an array.
my problem is:
it seems functions can't return array values.
it seems function can't accept array as parameter type.
so, what is the solution please in order to populate an array
and to use this array outside the function.
thank you
array populated by a function and used outside of function
- Marina Pashkova
- Posts: 2758
- Joined: 27 Jul 2007
Hi ts2mc,
An array can be passed into a function as an input. Or you can pass an array itself with its values. For example:
An array can also be passed through a reference (which is what you're looking for):
In this case an array passed to a function can be processed within the function's body:
Hope the above helps.
An array can be passed into a function as an input. Or you can pass an array itself with its values. For example:
Code: Select all
input: my_array[MAXSIZE](numericarray);
Code: Select all
input: my_array[MAXSIZE](numericarrayref);
Code: Select all
input: my_array[MAXSIZE](numericarrayref);
input: array_size(numericsimple);
for value1 = 0 to array_size begin
my_array[value1] = value1;
end;