Thema: Delphi array-Properties

Einzelnen Beitrag anzeigen

Benutzerbild von nailor
nailor

Registriert seit: 12. Dez 2002
Ort: Karlsruhe
1.989 Beiträge
 
#1

array-Properties

  Alt 6. Sep 2003, 16:32
Delphi-Quellcode:
//aus der Hilfe:

...

type

  TStringArray = class
  public
    property Strings[Index: Integer]: string ...; default;
    ...
  end;

If a class has a default property, you can access that property with the abbreviation object[index], which is equivalent to object.property[index]. For example, given the declaration above, StringArray.Strings[7] can be abbreviated to StringArray[7]. A class can have only one default property. Changing or hiding the default property in descendant classes may lead to unexpected behavior, since the compiler always determines an object’s default property statically.

...
jetzt sollte ich doch eigentlich irgendwie auf die strings in meinem array zugreifen können. d.h. sie auslesen, sie schreiben, und auch die Länge des arrays, in dem sie drinstehen ändern. Nur Teil 1 und Teil 2 kann ich nicht testen, weil Teil 3 (Länge des arrays, in dem sie drinstehen ändern) nicht klappt.
Michael N.
http://nailor.devzero.de/code/sharpmath/testing/ --- Tests, Feedback, Anregungen, ... aller Art sehr willkommen!
::: don't try so hard - it'll happen for a reason :::
  Mit Zitat antworten Zitat