FUNCTION NumberOfEnds > LOCAL lni, lnlast, lnresult > lnlast = ALEN(This.a_beams, 1) > lnresult = 0 > FOR lni = 1 TO lnlast > * Both the values in a_beams[lni, 1] and a_beams[lni, 2] are integers > lnresult = lnresult + (This.a_beams[lni, 1] * This.a_beams[lni, 2]) > NEXT > RETURN lnresult >ENDFUNCThe amount returned is then compared with the amount returned from a function with this format.
FUNCTION NumberOfNeedles > LOCAL lnresult, lngauge > * cGauge is a string in the format 1/10 > lngauge = EVALUATE(This.cGauge) > * nTuftedWidth is a numeric with up to 4 decimal places (ie. 146.4) > lnresult = This.nTuftedWidth / lngauge > RETURN lnresult >ENDFUNCBoth of these functions are called from another method and the results returned are compared, something like this
lnends = This.NumberOfEnds() >lnneedles = This.NumberOfNeedles() ><b>llresult = (lnends = lnneedles)</b> >IF NOT llresult > * Set the error property appropriately > This.nError = INVALID_BEAMSET >ENDIFWe ran across a situation where the comparison in bold was not being evaluated correctly. Further, we confirmed this by inserting a call to STRTOFILE() which output the values (using TRANSFORM() to change the numerics to strings) to a text file. Call was only issued if it appeared that the comparison resulted in .F.. However, the data in the text file matched exactly.
lnends = VAL(TRANSFORM(lnends)) >lnneedles = VAL(TRANSFORM(lnneedles))By inserting this code, the comparison is correctly yielding true, where before (with exactly the same data) it was yielding false. Note, nothing else in the code was modified. Again, this problem did not manifest itself when run on my machine using either the class directly or the COM object.