c# "rosetta stone"

Posted by jmls on 05-Oct-2008 06:27

is there any document that translates between c# and ABL ? It may be useful:

this == THIS-OBJECT

etc

etc

I'm trying to find the ABL equivalent of the c# line

foreach( FontFamily family in FontFamily.Families )

I know that the ABL does not support lists per se, but how do I know what the number of members in FontFamily.Families is, and how I reference them.

All Replies

Posted by Admin on 05-Oct-2008 06:46

Ok. The Families is an Array, not a collection. That's shown by the class browser. So the Length property returns the size, not Count as with Collections. This will work:

DEFINE VARIABLE i AS INTEGER NO-UNDO.

DEFINE VARIABLE len AS INTEGER NO-UNDO.

DEFINE VARIABLE family AS System.Drawing.FontFamily.

ASSIGN len = System.Drawing.FontFamily:Families:LENGTH .

DEFINE VARIABLE array AS System.Drawing.FontFamily EXTENT 100.

DO i = 0 TO len - 1:

ASSIGN family = CAST(System.Drawing.FontFamily:Families:GetValue(i),

System.Drawing.FontFamily) .

DISPL family:ToString() FORMAT "x(70)" WITH DOWN .

DOWN.

END.

We discussed the need for such a whitepaper with PSC during PSDN live! I believe the tenor was, that they are preparing one. This and other threads in this forum should be a good source.

(Again no answer points )

Posted by jmls on 05-Oct-2008 08:57

I think I know what you mean by "answer points" now ! I'll make sure that the next question is a question.

Thanks for the help.

This thread is closed