View previous topic :: View next topic
|
Author |
Message |
charlessxavier
New User
Joined: 12 Sep 2010 Posts: 4 Location: India
|
|
|
|
Hello all,
I just encountered this code in one of my easytrieve programs
IF HBFM = 1, 7
WACK = WACK + 1
GO TO JOB
END-IF
Which is asking the control to skip the record and go to job...
But what does a COMMA (,) mean here ? is it OR ?
please help me with this |
|
Back to top |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
WACK? OK, I'll leave it. Probably not your choice.
Have a look at "Field Series Condition" in your manual.
Yes, it is like an OR as far as the values in series are concerned. Or multiple identical IFs, except with a different value to match.
I've not used it, for the reason you have discovered. Someone looks at the code and just doesn't plain understand it. After a while, you realise it must be an "OR" of some sort, but not convinced until you hit the manual.
Easytrieve doesn't have an equivalent of 88s other than this. 88s is how you'd want to do it in Cobol.
I'd code out the ORs. At least any reader will understand when they see the code. I don't know what would happen if you have, say, three values but you miss the comma out for one of them. You could try, and let us know :-) |
|
Back to top |
|
|
charlessxavier
New User
Joined: 12 Sep 2010 Posts: 4 Location: India
|
|
|
|
Thanks a lot bill,
WACK is a variable for counting the number of records which satisfies the given condition, it is kind of acknowledgment variable...
And so if there are multiple values separated by Comas.. you mean to say the condition would be "either of" the values given.. right ? |
|
Back to top |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
Yes. As you suspected, it is like an OR. Either of two values or any of more than two values and the test will be true. |
|
Back to top |
|
|
charlessxavier
New User
Joined: 12 Sep 2010 Posts: 4 Location: India
|
|
|
|
Okay !!
Thanks a lot for helping out |
|
Back to top |
|
|
|