🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.delphi.language.objectpascal
Article #32495

Re: array of ... ???

#32495
From: Brendan Bosman
Date: Fri, 22 Nov 2002 14:19
45 lines
2161 bytes
> function GetPremBreakDown(var ACostTypeArray: array of TCostBreakDown;
>                           AListOfCosts: array of TCostStruct): boolean;
> begin
>     Finalize(ACostTypeArray);
>     SetLength(ACostTypeArray, Length(CostTypeArray)+1);
> end;


try this:

type
    TCostTypeArray =  array of TCostBreakDown;
    TListOfCosts: array of TCostStruct

 function GetPremBreakDown(var ACostTypeArray: TCostTypeArray ;
                           AListOfCosts: TListOfCosts): boolean;


??

Brendan Bosman


"Dion" <dion@softek.co.za> wrote in message
news:3dde320c@newsgroups.borland.com...
> Hi,
>
> Why can't I do the following?
>
> function GetPremBreakDown(var ACostTypeArray: array of TCostBreakDown;
>                           AListOfCosts: array of TCostStruct): boolean;
> begin
>     Finalize(ACostTypeArray);
>     SetLength(ACostTypeArray, Length(CostTypeArray)+1);
> end;
>
> I want to pass GetPremBreakDown an array declared in the calling proc, and
> add items to the array. However, I get an 'Incompatible types' error on
the
> SetLength(ACostTypeArray... line. Why???
>
> Thanks,
> Dion.
>
>
Technical Details
Message-ID: <3dde3d7b@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-03!sn-xit-06!sn-xit-08!supernews.com!newshosting.com!news-xfer1.atl.newshosting.com!news.stealth.net!news.stealth.net!208.184.7.66.MISMATCH!newsfeed1.cidera.com!Cidera!news.uni-x.net!newsgroups.borland.com!not-for-mail
References: <3dde320c@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 109d30,27bfb155f17a25ee
X-Google-Attributes: gid109d30,public
X-Google-ArrivalTime: 2002-11-22 07:16:07 PST
From: "Brendan Bosman" <brendan.bosman@syssol.ie>
Newsgroups: borland.public.delphi.language.objectpascal
References: <3dde320c@newsgroups.borland.com>
Subject: Re: array of ... ???
Date: Fri, 22 Nov 2002 14:19:58 -0000
Lines: 47
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2600.0000
X-MIMEOLE: Produced By Microsoft MimeOLE V6.00.2600.0000
NNTP-Posting-Host: 213.105.178.230
Message-ID: <3dde3d7b@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1037974907 213.105.178.230 (22 Nov 2002 06:21:47 -0800)
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-03!sn-xit-06!sn-xit-08!supernews.com!newshosting.com!news-xfer1.atl.newshosting.com!news.stealth.net!news.stealth.net!208.184.7.66.MISMATCH!newsfeed1.cidera.com!Cidera!news.uni-x.net!newsgroups.borland.com!not-for-mail