Re: Confessions of an "OO Foreigner"
From: LX-i (lxi0007_at_netscape.net)
Date: 12/31/03
- Previous message: Doug Scott: "Re: OT Golf WAS CoBOL moved to OO"
- In reply to: Donald Tees: "Re: Confessions of an "OO Foreigner""
- Next in thread: Donald Tees: "Re: Confessions of an "OO Foreigner""
- Reply: Donald Tees: "Re: Confessions of an "OO Foreigner""
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Wed, 31 Dec 2003 06:43:10 -0600
Donald Tees wrote:
> LX-i wrote:
>
>> Donald Tees wrote:
>>
>>> LX-i wrote:
>>>
>>>> I'm with you. Other languages use something like
>>>> return-value = object.method(parameters)
>>>>
>>>> I'm surprised they didn't say
>>>> INVOKE method-name OF object-name ...
>>>>
>>>> This utilizes a very familiar COBOL construct, which is used to
>>>> uniquely identify data items.
>>>>
>>>> Any of you savvier OO guys know of a reason that that wouldn't make
>>>> more sense?
>>>>
>>>>
>>>
>>> In reply to that latter, you can do exactly that by using the set
>>> property method to invoke a procedure.
>>>
>>> IE MOVE "action-required" TO INVOCATION-METHOD of object-name.
>>
>>
>>
>> Then, would you simply invoke the object? Is that second parameter
>> optional?
>>
>>
>
> You have to write a method that interpets "action-required" as a
> command. The point, though, is that a "MOVE data to property-name of
> object" is in fact the invocation of a method.
>
> Since the syntax you want actually executes code, you can use it for
> just about any command you want. For example:
>
> move "error 26" to display-line of console-one.
>
> will open a the console window (if one is not open), display "non-fatal
> error 26", ask for a character to be typed, then continue, with the
> following method.
>
> method-id. set property display-line.
> data division.
> working-storage section.
> 77 single-character picture x.
> linkage section.
> 77 console-line-in picture x(40).
> procedure division using console-line-in.
> display "non-fatal " console-line-in.
> display "type any key to continue".
> accept single-character.
> exit method.
> end method.
>
> I am not sure what you are asking. There is only one parameter,
> referenced to an instance of an object.
Well, I've never messed with OO COBOL (though I'd love to, and we've got
a pending DOD mandate that may force us to, which is fine with me), so
I'm not really familiar with the syntax. At some point in the program
with the "move", you'd have to instantiate "console-one" as an instance
of whatever object has that method, right?
-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~ / \ / ~ Live from Montgomery, AL! ~ ~ / \/ o ~ ~ ~ / /\ - | ~ LXi0007@Netscape.net ~ ~ _____ / \ | ~ http://www.knology.net/~mopsmom/daniel ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ I do not read e-mail at the above address ~ ~ Please see website if you wish to contact me privately ~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- Previous message: Doug Scott: "Re: OT Golf WAS CoBOL moved to OO"
- In reply to: Donald Tees: "Re: Confessions of an "OO Foreigner""
- Next in thread: Donald Tees: "Re: Confessions of an "OO Foreigner""
- Reply: Donald Tees: "Re: Confessions of an "OO Foreigner""
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|
|