2007-10-31 05:16 PM
2008-03-05 06:14 PM
GS wrote:
The GDL developers were a bit surprised that the code worked in AC 10. Here is the bad code in the zone stamp.
FOR i = 1 to 35 IF scales = GLOB_SCALE THEN aIndex = i found = 1 NEXT i IF found <> 1 THEN aIndex = 36
It should be replaced with this:
aIndex = 36 FOR i = 1 to 35 IF scales = GLOB_SCALE THEN aIndex = i endif NEXT i
Or this,
FOR i = 1 to 35 IF scales = GLOB_SCALE THEN aIndex = i found = 1 endif NEXT i IF found <> 1 THEN aIndex = 36As you can see, a very common programming error was made in the original code which should have been like the final code fragment to make sure that both assignments happen when the condition is true. The net result is that in the original code, Found was always 1, even if the scale was not matched. aIndex might never be assigned a value, but with found=1, aIndex certainly would never be assigned 36.
2008-03-05 07:23 PM
vfrontiers wrote:Sorry -- I guess I should clarify -- this was a purchased Stamp, customized for our needs, so I cannot post the actual Stamp. I have, however, notified its author of the issue and its fix.
Can you post the stamp here?
2009-04-07 09:29 PM