Solved

Function array

Posted on 2000-02-26
2
154 Views
Last Modified: 2010-04-04
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
Comment
Question by:MarioVDW
2 Comments
 
LVL 4

Accepted Solution

by:
mhervais earned 10 total points
ID: 2560928
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
 
LVL 6

Expert Comment

by:edey
ID: 2562088
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
In this video I am going to show you how to back up and restore Office 365 mailboxes using CodeTwo Backup for Office 365. Learn more about the tool used in this video here: http://www.codetwo.com/backup-for-office-365/ (http://www.codetwo.com/ba…
Both in life and business – not all partnerships are created equal. As the demand for cloud services increases, so do the number of self-proclaimed cloud partners. Asking the right questions up front in the partnership, will enable both parties …

863 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

26 Experts available now in Live!

Get 1:1 Help Now