When you move a negative value to a numeric edit item and the - sign would/should be where a , is a space is moved in front of the number.
See attached program sample.
Moving a data item with a value -100 to an edit item pic --,---,--9 should result as -100 not - 100.
Michael :-)
I have a new commit ready in which I have rewritten the function dealing with moving to a numeric edited field. So I'll test your code with my new version and post the results here.
Chuck Haatvedt
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Chuck
If your gona test my code, here is some testing I did before submitting my original post.
What I noticed is that moving a literal to an edit pattern will work at times that moving the same value from an identifier will fail.
If you move an identifier-1 that defines more digits than the receiving identifier-2, it is not always handled correctly.
See attach program and its' output.
Michael :-)
thanks for reporting this I think know what is causing the blank between the floating sign and the digits. I need to check what the cobol standard is for this condition.
I know the issue for the following problem, but I need to work with Simon as COBC is generating the cob_field attributes incorrectly for this edited field...
please login when responding. It is best to know who we are replying to..
In regards to the above, all is well. I may have responded a bit harshly during a long and difficult debugging period working on fixing bugs related to my efforts on cases involving moving / displaying NUMERIC DISPLAY EDITED data.
I'm making progress and finally have a version which passes all the test cases included in the build regression testsuite. I've added a couple of additional tests to validate conditions which slipped through the testsuite before.
Chuck Haatvedt
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
This issue has been resolved.
Downloaded GNUCOBOL-X32-BDB from Chucks' post in GNUCOBOL forum.
See topic New test build of GNUCOBOL 3.3dev...
Michael :-)
Last edit: Michael F Gleason 2024-07-17
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
When you move a negative value to a numeric edit item and the - sign would/should be where a , is a space is moved in front of the number.
See attached program sample.
Moving a data item with a value -100 to an edit item pic --,---,--9 should result as -100 not - 100.
Michael :-)
Michael,
I have a new commit ready in which I have rewritten the function dealing with moving to a numeric edited field. So I'll test your code with my new version and post the results here.
Chuck
If your gona test my code, here is some testing I did before submitting my original post.
What I noticed is that moving a literal to an edit pattern will work at times that moving the same value from an identifier will fail.
If you move an identifier-1 that defines more digits than the receiving identifier-2, it is not always handled correctly.
See attach program and its' output.
Michael :-)
Michael,
thanks for reporting this I think know what is causing the blank between the floating sign and the digits. I need to check what the cobol standard is for this condition.
I know the issue for the following problem, but I need to work with Simon as COBC is generating the cob_field attributes incorrectly for this edited field...
Note the number of digits should be 8 not 7.
Thanks again,
Chuck Haatvedt
patience, we are working on this...
PIC $,$$$,$$9.99CR.
or, alternatively, with no $ sign
PIC Z,ZZZ,ZZ9.99-
libcob/common.h
** #define COB_FIELD_TYPE(f) ((f)->attr->type)
** #define COB_FIELD_DIGITS(f) ((f)->attr->digits) <-- DIGITS
** #define COB_FIELD_SCALE(f) ((f)->attr->scale) <- DECIMALS
** #define COB_FIELD_FLAGS(f) ((f)->attr->flags)
** #define COB_FIELD_PIC(f) ((f)->attr->pic)
** #define COB_FIELD_HAVE_SIGN(f) ((f)->attr->flags & COB_FLAG_HAVE_SIGN)
** #define COB_FIELD_SIGN_SEPARATE(f) ((f)->attr->flags & COB_FLAG_SIGN_SEPARATE)
** #define COB_FIELD_SIGN_LEADING(f) ((f)->attr->flags & COB_FLAG_SIGN_LEADING)
:-)
Note the number of digits should be 8 not 7.
05 EX-2 PIC [$,$$$,$$9].99[CR].
No!
Should be... seven!
Sign is something else!
:-)
run this program and count the number of digits in the output displays...
If you wish to be helpful, then do some testing otherwise please refrain from attacking the work and efforts of those who are trying to help.
please login when responding. It is best to know who we are replying to..
In regards to the above, all is well. I may have responded a bit harshly during a long and difficult debugging period working on fixing bugs related to my efforts on cases involving moving / displaying NUMERIC DISPLAY EDITED data.
I'm making progress and finally have a version which passes all the test cases included in the build regression testsuite. I've added a couple of additional tests to validate conditions which slipped through the testsuite before.
This issue has been resolved.
Downloaded GNUCOBOL-X32-BDB from Chucks' post in GNUCOBOL forum.
See topic New test build of GNUCOBOL 3.3dev...
Michael :-)
Last edit: Michael F Gleason 2024-07-17