我是个初学者,这个学期我要学习Cobol语言。在互联网上,关于OOP cobol的例子很少,甚至没有例子。理论上只有st这样的例子,他们没有告诉我如何添加更多的st (就像Java中的main )来查看程序的工作情况。我有一些这样的代码:
class-id. A data is protected
inherits from Base.
object section.
method-id. "newWithData"
linkage section.
01 lnkObject
我有一个关于COBOL上的XML Generate函数的案例。我现在的写字簿:
01 ABC.
02 a PIC X(02) VALUE SPACES.
02 b PIC X(02) VALUE SPACES.
02 c PIC X(02) VALUE SPACES.
结果:
<ABC><a>aa</a><b>bb</b><c>cc</c></ABC>
但是我有最大长度的输出只有ZZ字符。因此,我想我必须在其中插入一个带有预期结果的"enter“字符:
<ABC
当我开始学习如何测试一个程序时,我学到的就是用与测试程序相同的语言使用一个库或包。例如,
- if a tested program is written in Python, its testing program is also written in Python and uses `UnitTest` class in the python standard library
- if a tested program is written in C++, its testing program is also written in C++ and uses some test