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

support for OCCURS #38

Open
GitMensch opened this issue May 26, 2020 · 2 comments
Open

support for OCCURS #38

GitMensch opened this issue May 26, 2020 · 2 comments

Comments

@GitMensch
Copy link
Contributor

we are still missing TABLEs and I have no idea how to tackle it.

Originally posted by @brunopacheco1 in #30 (comment)

@GitMensch
Copy link
Contributor Author

This one should really be tracked separately so I've moved it here.

Theoretically cobc could generate an array of cob_fields for this, pre-set with the actual field position, but an OCCURS UNBOUNDED would be cob_field[999999998] which brings up another question: How much items in occurs should be shown in general, and how to ask the UI to print/set my-item(685743) and how to print/set my-other-item(1, 4, 3) (nested OCCURS)?
What about OCCURS 0 TO 9876 DEPENDING on some-var and some-var being 3 - or 9866?

Implementation-wise the simple some-item OCCURS 10 could theoretically be done with a single cob_field for some-item that the extension sets the offset with "field data + field size * (entry - 1)" before using it, but this won't work for anything more complex...

@GitMensch
Copy link
Contributor Author

I suggest to have a look at the dump code that is generated with -fdump-all as it shows how OCCURS can be handled (resolving the amount of the appropriate depending variable or max constant first, then using an intermediate cob_field to output the data via the existing field logic). With the use of #92 this can be also generated (as comment) without being active.

@brunopacheco1 Would you mind giving this a try?

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

1 participant