Re: Is this a bug in 4GL 4.10?
Posted in 1992
In article <1992May18.204436.4282@mips.mitek.com> you write: }Consider this 4gl program: } }MAIN } }DEFINE a ARRAY[10] OF INTEGER, } b ARRAY[10] OF INTEGER, } c INTEGER } }FOR c = 1 TO 10 } LET a[c] = b[c] = 0 }END FOR } }FOR c = 1 TO 10 } DISPLAY c, " ", a[c], " ", b[c] }END FOR } }END MAIN } }When you run this program, these are the results: }$ fglgo junk } 1 1 0 } ... } 10 1 0 } }script done on Mon May 18 15:41:10 1992 } }Is this the result I should expect? Or is this a bug? }This 4gl (4.10.UD2) is running on a RS/6000 (AIX 3.1) } }============================================================================ }John Maddox (jmaddox@dbaix.oc.com) * OpenConnect Systems * Tel: 214-490-4090 It is precisely what I would expect under I4GL-RDS. You would have got gibberish if you'd used I4GL (compiled). Your problem is too much C. Your assignment is evaluating the truth of (b[c] == 0) in C-speak. Now, it so happens that in I4GL-RDS (but not compiled I4GL), that all local variables are initialised to zero, so the evaluated condition is always true, hence the result. Assignment in I4GL is not associative as it is in C. -- Jonathan Leffler (johnl@informix.com) #include <disclaimer.h>