Forum Post: RE: Does data type derive from Progress.Lang.Object?

  • Thread starter Thread starter Peter Judge
  • Start date Start date
Status
Not open for further replies.
P

Peter Judge

Guest
Curiosity 1) Is all data type derive from a base class in OOABL? If yes, which class? No. Primitive types (INT, INT64, DECIMAL, CHAR, LONGCHAR, etc), arrays (CHAR EXTENT etc) and temp-tables/prodatasets are not OO (for historical reasons – these types predate OO in ABL). All complex user-defined types (aka objects) inherit from Progress.Lang.Object. In the GUI for .Net, System.Object also inherits from Progress.Lang.Object. Curiosity 3) In my code, why I can do o = i but I cannot use i as a parameter of the the same data type of o ? There is some autoboxing that happens with .NET objects. I'm not sure why this fails in one case but not the other. This works: TestNet( box ( 4 )). There's no boxing (auto or otherwise) with OOABL. -- peter From: sderrico [mailto:bounce-shapeshifter999@community.progress.com] Sent: Thursday, 20 March, 2014 13:46 To: TU.OE.Development@community.progress.com Subject: Does data type derive from Progress.Lang.Object? Does data type derive from Progress.Lang.Object? Thread created by sderrico Hello Group! Could you please help me to understand a basis in OOABL? I attached an example. I created two methods, one with a parameter of type Progress.Lang.Object and another with System.Object. Curiosity 1) Is all data type derive from a base class in OOABL? If yes, which class? Curiosity 2) In my code, why I cannot pass a value, like 4, in both method as a parameter? Curiosity 3) In my code, why I can do o = i but I cannot use i as a parameter of the the same data type of o ? /* declaration */ DEFINE VARIABLE i AS INTEGER NO-UNDO INITIAL 4. DEFINE VARIABLE o AS System.Object NO-UNDO . /* initialization */ o = i . /* Success */ TestNet( o ). /* Error: Parameter 1 for METHOD TestPro is not compatible with its definition (12905) */ TestPro( i ). TestPro(4). /* Error: Parameter 1 for METHOD TestNet is not compatible with its definition (12905) */ TestNet(4). /* T E S T P R O */ METHOD STATIC PUBLIC VOID TestPro( INPUT p AS Progress.Lang.Object): MESSAGE p VIEW-AS ALERT-BOX. END METHOD. /* T E S T N E T */ METHOD STATIC PUBLIC VOID TestNet( INPUT p AS System.Object): MESSAGE p VIEW-AS ALERT-BOX. END METHOD. Thank you! Sebastien Stop receiving emails on this subject. Flag this post as spam/abuse.

Continue reading...
 
Status
Not open for further replies.
Back
Top