• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 164
  • Last Modified:

Function array

Hi,

Is it possible to write a function that returns a array of integers?

If it is possible please show me a exemple of it.
0
MarioVDW
Asked:
MarioVDW
1 Solution
 
mhervaisCommented:
You can create a class that holds an array if integers and write a function that returns an instance of if

like :

TMyarray = class(tobject);
private
  myarr : array of integer;
end;

and a function :

function myfunc : TMyarray;

regards, Marc
0
 
edeyCommented:
you can also return a pointer to an array of integers.  D4+ gives you open arrays, for D2..3 try

type
 TIntegerArray = array[0..0] of Integer;
 PIntegerArray = ^TIntegerArray;

just remember to give the number of elements in the array

GL
Mike
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Tackle projects and never again get stuck behind a technical roadblock.
Join Now