Skip to content

use of functions to get length #8

@GitMensch

Description

@GitMensch

Currently there is a loop in COBOL, which always stops at the first space.
Instead of this we could use intrinsic functions to only handle trailing spaces and to improve performance as follows:

      *>  GnuCOBOL (+ gcobol) only
               MOVE FUNCTION
                    STORED-CHAR-LENGTH (some-text) TO last-pos
      *>  ISO2002+
               MOVE FUNCTION
                    LENGTH (  FUNCTION TRIM ( some-text TRAILING ) ) TO last-pos

The question is: should embedded spaces be allowed and would you be interested in something like this?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions