Re: Confessions of an "OO Foreigner"

From: Donald Tees (donald_tees_at_nospam.sympatico.ca)
Date: 12/31/03


Date: Tue, 30 Dec 2003 21:07:48 -0500

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.

Donald
PS. Code is per Fujitsu Version 5.0 I think it is pretty close to the
new standard.