Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ENHANCEMENT] Array initializer #294

Open
axtens opened this issue Jun 23, 2023 · 2 comments
Open

[ENHANCEMENT] Array initializer #294

axtens opened this issue Jun 23, 2023 · 2 comments

Comments

@axtens
Copy link

axtens commented Jun 23, 2023

Currenly the test case says

TestCase "Latest score"
        MOVE '100,0,90,30' TO WS-SCORES
        MOVE "latest" TO WS-PROPERTY
        PERFORM HIGH-SCORES
        EXPECT WS-RESULT = 30

In HIGH-SCORES, WS-SCORES needs to UNSTRINGed into a table. Another option is to move '100000090030' to WS-SCORES and decompose the data with working-storage structures.

Assuming a WS-SCORES-TABLE with sufficient space to hold the elements, an instruction 'MOVE-EACH' is suggested that parses the supplied list of values into the table, e.g.

MOVE-EACH 100,0,90,30 TO WS-SCORES-TABLE

If the table is of strings, allow for the MOVE-EACH to handle then viz

MOVE-EACH 'Agaricomycetes','Arthoniomycetes','Coniocybomycetes','Dothideomycetes','Eurotiomycetes','Lecanoromycetes','Lichinomycetes','Sordariomycetes' TO WS-LICHEN-FUNGAL-CLASSES-TABLE
@Rune-Christensen
Copy link
Collaborator

Hi @axtens
Thank you for your interest in COBOL Check :-)
Just to clarify: you would want to use the MOVE-EACH statement instead of the first MOVE statement in your example?

If you wanted to use it in HIGH-SCORES, it would be out of scope for COBOL Check, and would have to be added as an ordinary COBOL statement.

@axtens
Copy link
Author

axtens commented Jun 26, 2023

It's a suggestion to extend the command set for cobolcheck itself. There's no MOVE-EACH in the COBOL dialect I use (GnuCOBOL) and likely never will be.

The suggestion comes from having to write my COBOL in such a way asto be able to use cobolcheck to test my COBOL.

-Bruce

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants