So I have an Iterate over a DSP segment on a result. What I want to do is leave the Iterate if I hit a DSP segment that has a certain value in DSP:3. Is that possible?
What I would do is initialze a temp variable to zero before the ITERATE.
Then inside the ITERATE I would check for the temp variable to be qual to =0. If that is true then inside that If I would have another IF checking to see if the DSP conditin is true. If the DSP condition is true then I would set the temp variable to =1 else I would do whatever is needed inside the ITERATE.
So the ITERATE continues but only does meaningful work until the first time the DSP condition is true. Once the condition is true the ITERATE continues but because of the logic nothing else gets done.
email: jim.kosloskey@jim-kosloskey.com 29+ years Cloverleaf, 59 years IT - old fart.
I would do it (and I think I have done it) the way Jim describes. But I was wondering what would happen if you assign a ridiculously large number to the iteration variable as soon as the DSP condition is true. Not sure what variable you use, so I assume %s1, so something like
Code:
COPY =99999 -> $%s1
It should leave the iteration as well. Maybe worth trying (no time to try it myself atm).
Zuyderland Medisch Centrum; Heerlen/Sittard; The Netherlands
I suspect that would work – after all it is a method we use with List ITERATES to control looping but I would never be confident that no matter how high a number I set the input might one time be greater – then I would have a real trouble-shooting issue.
I think the way I described, while more work, is the most bullet proof.
Of course it would be nice to have a break function inside the ITERATE (that has been requested in the past).
email: jim.kosloskey@jim-kosloskey.com 29+ years Cloverleaf, 59 years IT - old fart.
Author
Replies
Viewing 3 reply threads
The forum ‘Cloverleaf’ is closed to new topics and replies.