Why does COBOL have both `SECTION` and `PARAGRAPH`?

后端 未结 9 1274
一向
一向 2021-02-18 16:23

Why does COBOL have both SECTION and PARAGRAPH?

Can anybody explain why the designers of COBOL created both SECTIONs and PAR

9条回答
  •  佛祖请我去吃肉
    2021-02-18 16:43

    For one thing, paragraph names must be unique unless they are in separate sections, so sections allow for "namespacing" of paragraphs.

    If I recall correctly, the only reason you must use a SECTION is for DECLARATIVES. Aside from that they are optional and primarily useful for grouping paragraphs. I think it's common (relatively speaking, anyway) to require that PERFORM be used on paragraphs only when they are in the same section.

提交回复
热议问题