Delphi-PRAXiS

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   Object-Pascal / Delphi-Language (https://www.delphipraxis.net/32-object-pascal-delphi-language/)
-   -   Delphi FindComponent mit ARRAY?? (https://www.delphipraxis.net/79005-findcomponent-mit-array.html)

TurboMartin 14. Okt 2006 15:14


FindComponent mit ARRAY??
 
Ich möchte einem Array einen Wert zuweisen mit arrayname[i].
Dabei läuft dies in einer Schleife ab, weswegen ich es mit FindComponent
probiert hab:

Delphi-Quellcode:
for i:=1 to 3 do
begin
  with (FindComponent('z'+IntToStr(i)) as array {[1..3] of Integer}) do
  begin
    [1] := 1 {Wert};
    [2] := 2 {Wert};
  end;
end;
Allerdings klappt das nicht.
Ich kriege immer den Fehler "Expression expected but 'ARRAY' found" bzw. "Class does not have a default property".
Aber wie kann ich jetzt was zuweisen? :gruebel:

Dax 14. Okt 2006 15:17

Re: FindComponent mit ARRAY??
 
Sowas geht grundsätzlich nicht ;)

Du könntest dir höchstens ne Komponente suchen, die eine TList wrapt, der den Namen verpassen und dann die suchen.. :gruebel:

mkinzler 14. Okt 2006 15:22

Re: FindComponent mit ARRAY??
 
Was für einen Typ hat z denn?


Alle Zeitangaben in WEZ +1. Es ist jetzt 01:13 Uhr.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz