Hallo, hier mal meine neue Klasse:
Delphi-Quellcode:
unit Whazzup;
interface
type TWhazzupData =
record
CallSign :
String;
VID :
String[6];
RealName :
String;
ClientType :
String;
Frequency :
String[7];
Latitude : Extended;
Longitude : Extended;
Alitutde : Integer;
GroundSpeed : Integer;
Planned_Aircraft :
String;
Planned_WakeTurbulance :
String[1];
Planned_TasCruise :
String;
Planned_DepartureAirport :
String[4];
Planned_Altitude :
String;
Planned_DestinationAirport :
String[4];
Server :
String;
Protrevision :
String;
Rating :
String;
Transponder :
String[4];
FacilityType :
String;
VisualRange :
String;
Planned_Revision :
String;
Planned_FlightType :
String[1];
Planned_DepartureTime :
String;
Planned_ActualDepartureTime :
String;
Planned_HoursEnRoute :
String;
Planned_MinutesEnRoute :
String;
Planned_HoursFuel :
String;
Planned_MiutesFuel :
String;
Planned_AlternateAirport :
String[4];
Planned_Remarks :
String;
Planned_Route :
String;
Planned_DepartureAirportLatitude : Extended;
Planned_DepartureAirportLongitude : Extended;
Planned_DestinationAirportLatitude : Extended;
Planned_DestinationAirportLongitude : Extended;
ATIS_Message :
String;
Time_LastATISRecieved :
String;
Time_Connected :
String;
Client_SoftwareName :
String;
Client_SoftwareVersion :
String;
Adminrating :
String;
ATC_or_Pilot_Rating :
String;
Planned_AlternatAirport2 :
String[4];
Planned_TypeOfFlight :
String[1];
Planned_PersonsOnBord :
String;
True_Heading : Integer;
OnGround : Boolean;
end;
type TWhazzupArray =
array of TWhazzupData;
type TWhazzup =
class(TObject)
private
FWhazzup : TWhazzupArray;
{read / write functions}
function readCallSign :
String;
procedure writeCallSign(ACallSign :
String);
public
property CallSign :
string read readCallSign
write writeCallSign;
constructor create;
destructor destroy;
override;
end;
implementation
{Constructor}
constructor TWhazzup.create;
begin
end;
{destructor}
destructor TWhazzup.destroy;
begin
end;
{Read / Write Properties}
function TWhazzup.readCallSign:
String;
begin
end;
procedure TWhazzup.writeCallSign(ACallSign :
String);
begin
end;
end.
Meine Frage ist jetzt, wenn ich die Klasse erzeuge, dann möchte ich auf die Inhalte von FWhazzup zugreifen. Da FWhazzup ein Array ist, muss ich ja Irgendwie noch einen Index dafür übergeben.
Wie mache ich das am besten?
Das ganze sollte am Ende so aussehen wenn ich es aufrufe:
Delphi-Quellcode:
Whazzup := TWhazzup.create;
Whazzup[0].CallSign := 'Test';
wie mache ich dass dann in der Klasse mit dem Überabe Index?
Vielen Dank!