Solved

Function array

Posted on 2000-02-26
2
158 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Enroll in June's Course of the Month

June’s Course of the Month is now available! Experts Exchange’s Premium Members, Team Accounts, and Qualified Experts have access to a complimentary course each month as part of their membership—an extra way to sharpen your skills and increase training.

Question has a verified solution.

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

This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
If you're a developer or IT admin, you’re probably tasked with managing multiple websites, servers, applications, and levels of security on a daily basis. While this can be extremely time consuming, it can also be frustrating when systems aren't wor…
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…

696 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