![]() |
Von record auf Class
Hi
Delphi-Quellcode:
Ich habe wahrscheinlich eine Total simple Frage, aber wie kann ich daraus eine Klasse(TPersistent) machen? Arrays akzeptiert der Compiler in Properties nicht.
type TEmails = record
Server: String; Benutzername: String; Passwort: String; end; type TMessengers = record Protokoll: String; Benutzername: String; Passwort: String; end; type TWebsite = record Website: String; Benutzername: String; Passwort: String; end; type TAccounts = record Emails: Array of TEmails; Messengers: Array of TMessengers; Website: Array of TWebsite; end; |
Re: Von record auf Class
HI,
a) würde ich nicht unbedingt eine Klasse von TPersistent ableiten, sondern eine von TObject! b)
Delphi-Quellcode:
Bernhard
type TAccounts = class
private fEmails: Array of TEmails; fMessengers: Array of TMessengers; fWebsite: Array of TWebsite; public property Email[index: Integer]: TEmails read GetEmails write SetEmails; // property ... end; |
Re: Von record auf Class
Zitat:
Delphi-Quellcode:
jupp, ganze Array's nicht, aber einzelne Elemente akzeptiert der und den Index dazu bekommt man in das Property mit rein.
property Email[index: Integer]: TEmails read GetEmails write SetEmails;
Zitat:
|
Re: Von record auf Class
Zitat:
|
Re: Von record auf Class
Zitat:
|
Alle Zeitangaben in WEZ +1. Es ist jetzt 14:27 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 by Thomas Breitkreuz