V G K Dinavahi wrote:
> I would like to bring to your notice a small bug in tinycobol array display.
> I herewith enclosing a small code.
> In this code I used occurs to accept input from user and display
> the same immediately.
> But it is displaying the first name only.
> But it storing w-name 10 times in occurs if we used to display
> w-name(1),w-name(2)...w-name(10) like that it is showing correctly.
> But putting in loop and displaying like display w-name(i) until 10 times
> it is not showing properly.
> I Checked the same code with OpenCobol and Microfocus cobol also in those
> compilers it is showing correctly.
>
> If possible fix the same before release the new version.
Yes, this is a bug which was present in version 0.63.
I will try to fix it for version 0.64.
In the meantime you can use a non-indexed identifier as a work around.
Basically you can use an non-indexed identifier to display/accept the
data, and then move the data into the indexed identifier.
You can then display the input data using an indexed identifier, as in
the enclosed a working example.
...
working-storage section.
01 w-rec.
05 w-name pic x(10) occurs 10 times.
01 w-name-1 pic x(10).
01 i pic 9(02).
01 loc-i pic 9(04).
01 loc-name pic 9(04).
01 dummy pic x(01).
procedure division.
A000.
move 1 to i.
move all '+' to w-rec.
perform main-para
until i > 4.
move 1 to i.
move 1101 to loc-i.
move 1116 to loc-name.
perform end-para
until i > 5.
accept dummy at 1627.
stop run.
main-para.
display i at 1001.
accept w-name-1 at 1005.
move w-name-1 to w-name(i).
display w-name-1 at 1016.
accept dummy at 1027.
move '-------' to w-name-1.
display w-name-1 at 1016.
add 1 to i.
end-para.
display i at loc-i.
display w-name(i) at loc-name.
add 100 to loc-i.
add 100 to loc-name.
add 1 to i.
Final display using TC 0.63.103:
04 4444444444 ------- 4
01 1111111111
02 2222222222
03 3333333333
04 4444444444
05 ++++++++++
Hope this helps.
|