我是初学者,实际上这个学期我不得不研究Cobol语言。在互联网上,有一些例子,甚至没有关于OOP cobol的例子。理论上只有一个例子,他们没有告诉我如何添加更多的东西(比如Java中的main)来查看程序的工作。 我有一些代码是这样的:需要一个OOP Cobol的实例吗?
class-id. A data is protected
inherits from Base.
object section.
method-id. "newWithData"
linkage section.
01 lnkObject object reference.
01 lnkName pic x(80).
procedure division using lnkName
returning lnkObject.
*----Create a new instance of A using the "new" method from Base
invoke super "new" returning lnkObject
*----Send it an initialize message.
invoke lnkObject "initialize" using lnkName
exit method.
end method "newWithData".
object.
object-storage section.
01 theName pic x(80).
...
method-id. "initialize"
linkage section.
01 lnkName pic x(80).
procedure division using lnkName.
*----Store the initialization parameter in the object's
* instance data
move lnkName to theName
exit method.
end method "initialize".
end object.
end class "A".
,但我不知道该怎么办好(理论和实践)。任何人都可以告诉我如何? 这将是最好的帮助我的另一个例子和解释。
事实上,我必须将它作为一种编程语言来学习,然后推理它的特性+范例。该项目需要我自己创造一个代表Cobol范例和特征的大范例。这就是为什么我需要了解它是如何工作的 – Silentbang 2011-06-13 14:44:34