返回介绍

6.7 CONTENT-OF

发布于 2023-07-03 22:07:03 字数 701 浏览 0 评论 0 收藏 0

FUNCTION CONTENT-OF returns an alphanumeric field given a pointer and optional length:

Data from pointer is returned as a COBOL field either by scanning for a NUL byte or using the optional length. Reference modification of result allowed.

       identification division.
       program-id. contents.
       data division.
       working-storage section.
       01 ptr   usage pointer.
       01 str   pic x(4) value z"abc".

      *> Testing CONTENT-OF
       procedure division.

       set ptr to address of str
       display content-of(ptr)
       display content-of(ptr, 2)
       display content-of(ptr)(2:2)

       goback.
       end program hosted.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
    我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
    原文