View previous topic :: View next topic
|
Author |
Message |
passion_sujesh
New User
Joined: 14 Mar 2008 Posts: 74 Location: India,Chennai
|
|
|
|
Hi all,
I have a doubt in using an array in 'if' condition. iam getting compilation error . Can u please help me solve this.
Error message:
variable was not a uniquely defined name. The definition to be used could not be determined from the context. The reference to name was discarded. Expected a reference modification specification but found ")". the if statement was discarded.
In the code i am comparing old value and new value in an field.
Copy book layout:
layout1:
Code: |
---------
01 key-field.
05 field1 pic x(05).
05 field2 pic x(05).
05 field3 occurs 2 times.
10 field4 pic x(05).
10 field5 pic x(05). |
Code:
Code: |
ID Division.
.
.
.
Copy layout1 replacing ==key-field== by ==new-field==.
Copy layout1 replacing ==key-field== by ==old-field==.
.
.
if field4 (1) of new-field not= field4 (1) of old-field
display ' mismatch'
end-if.
.
. |
Note: for normal variables (not array elements) it is fine, i am not getting ay error. I am getting this error only while comparing array elements.
please help me solving this.
Thanks in advance. |
|
Back to top |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
Back to top |
|
|
passion_sujesh
New User
Joined: 14 Mar 2008 Posts: 74 Location: India,Chennai
|
|
|
|
Hi dbzTHEdinosauer,
Thanks, it has helped me a lot. |
|
Back to top |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
glad you were able to solve your problem. |
|
Back to top |
|
|
|