I have a block of code in a program that looks like this:
DO 20 I=1, No_Of_Nodes
IA=WINIO@('%nl&')
IA=WINIO@('%co[check_on_focus_loss]&')
IA=WINIO@('%`bg[window]%`rs &', PQ(I))
IA=WINIO@('%il%`bg[window]%^rd%`il°%ta &',
& 0,359,MD(I), ISUM_ANGLES)
IA=WINIO@('%il%`bg[window]%^rd%`il'' &',
& 0,59, MM(I), ISUM_ANGLES)
IA=WINIO@('%il%`bg[window]%^rd%`il' &',
& 0,59, MS(I), ISUM_ANGLES)
IA=WINIO@('%co[full_check]&')
IF (I .EQ. No_Of_Nodes) GO TO 20
IA=WINIO@('%2ta%`bg[window]%`rs and %`bg[window]%`rs%ta&',
& PQ(I), PQ(I+1))
IA=WINIO@('%`bg[window]%^rf (m)&', DIST(I), ISUM_ANGLES)
20 CONTINUE
PQ is an array of 4-char names, MD, MM, MS are arrays of degrees, minutes and seconds, DIST is an array of distances which may have a decimal part, and because of the nature of the problem, one distance is known so I have input of one less distance than the number of angles. ISUM_ANGLES is a callback that sums the angles and compares to the (2n+4) right angles around the outside of a polygon. It also checks that none of the distances are zero or negative, and if these criteria are met, a button is un-greyed so that the computation may progress.
If the %co codes are omitted, some of the boxes have a nasty habit of losing their last digit when the user is entering data in a different box. Needless to say, this is irritating in the extreme. If the %co[full_check] code is where I have it (above), this behaviour occurs in the DIST boxes, but not the MD, MM or MS boxes. If I pull both %co codes outside the loop, then the digit-dropping doesn't occur - but then the focus is never lost from the last box, whatever it is, and the elegance of revealing the 'continue' button is lost.
I suspect that the answer is to hang the ISUM_ANGLES callback onto a %dl with an appropriately short delay, but it is late and I may try that in the morning.
I normally don't get on well with %il, and usually check the limits myself in a callback when the need arises. Perhaps this is one of those cases where I need 2 callbacks. I did note that taking %il out from the degrees (MD) box changes its size, which is also rather frustrating, but no doubt I can get the sizes right again with %nrd etc and a bit of trial and error.
I would be very grateful if anyone can shed light on this behaviour, or even better, its solution.
(Using 32bit Win7 and v6.10)
Eddie