![]() |
Kann ich ein Array als Rückgabewert einer Function ausgeben?
Warum funktioniert die Zeile nicht?
Was mach ich falsch? function primzahlerzeugen(): array[1..2] of Integer; Bin leider noch totaler Anfänger... Danke, fapsons |
Re: Kann ich ein Array als Rückgabewert einer Function ausge
Delphi-Quellcode:
type TmyArray=array[1..2] of integer;
. . . function test:TmyArray; |
Re: Kann ich ein Array als Rückgabewert einer Function ausge
Hallo,
ich würde das array von der aufrufenden Funktion "erstellen" lassen (var arr: TXXX) und bei der Rückgabefunktion als var übergeben
Delphi-Quellcode:
Heiko
type
TArr = .. procedure Prim(var theArr: TArr); begin end; procedure Caller; var Arr: TArr; begin Prim(Arr); end; |
Re: Kann ich ein Array als Rückgabewert einer Function ausge
Vielen Dank, hat super geklappt!!!
|
Alle Zeitangaben in WEZ +1. Es ist jetzt 12:58 Uhr. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024-2025 by Thomas Breitkreuz