Embarcadero Pascal To Xojo

Hello everyone,

i try to translate a Gedcom-Parser-Lib from Embarcadero Pascal to Xojo. Now i’m implement some main structures.

Pseudo Pascal Code

TGEDCOMTree = class(TGEDCOMObject, IUnknown, IGEDCOMContainer) private function GetRecords(Index: Integer): TGEDCOMRecord; public property Records[Index: Integer]: TGEDCOMRecord read GetRecords; end;

Just a little thing, i don’t now, how to translate.

Xojo private Method (no problem)

Private Function GetRecords(Index As Integer) As GEDCOMRecord End Function

calculated properties should be

Property Records(Index As Integer) As GEDCOMRecord Get Return GetRecords(Index) End Get End Property

But how can i implement that in Xojo?

Tanks everyone :wink:

[quote=32967:@Martin Trippensee]Hello everyone,

i try to translate a Gedcom-Parser-Lib from Embarcadero Pascal to Xojo. Now i’m implement some main structures.

Pseudo Pascal Code

TGEDCOMTree = class(TGEDCOMObject, IUnknown, IGEDCOMContainer) private function GetRecords(Index: Integer): TGEDCOMRecord; public property Records[Index: Integer]: TGEDCOMRecord read GetRecords; end;

Just a little thing, i don’t now, how to translate.

Xojo private Method (no problem)

Private Function GetRecords(Index As Integer) As GEDCOMRecord End Function

calculated properties should be

Property Records(Index As Integer) As GEDCOMRecord Get Return GetRecords(Index) End Get End Property

But how can i implement that in Xojo?

Tanks everyone ;)[/quote]

Well unlike most other languages a property can be replaced by a method with NO syntax chnages to the user of the class
I’d make this a method like

Sub Records(Index As Integer) As GEDCOMRecord Return GetRecords(Index) End Sub

I believe that part of your problem is not knowing part of your data.
Can you implement TGEDCOMObject and define the TGEDCOMRecord?
Have you read about modules, classes, interfaces, structures, methods, properties and computed properties in Xojo?
I am pretty sure that after reading a bit and playing around with those “bricks”, you’ll be able to build your “wall”.