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
Curiosity 1) Is all data type derive from a base class in OOABL? If yes, which class?
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?
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
Flag this post as spam/abuse.
Curiosity 1) Is all data type derive from a base class in OOABL? If yes, which class?
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?
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
Flag this post as spam/abuse.
Class objects in ABL derive from Progress.Lang.Objects, but primitives like integer do not. In some languages, there are two versions, e.g., String and string where the former is an object and the later is not. ABL currently only has the latter. It is on the wish list to have such things www.oehive.org/OOWishList
@Peter: Box works perfectly, thank you!
@Thomas: Nice list! This will be very good for Progress when this list will be implemented. Also with Multithreading as you suggested in another post.
Note that some of the list items have been translated to the Ideas section of this site, so you might want to go there and vote for them.