[futurebasic] Wierd FB behaviour. Surely not my fault :-)

Message: < previous - next > : Reply : Subscribe : Cleanse
Home   : January 1998 : Group Archive : Group : All Groups

From: Mark Goodes <wave@...>
Date: Sun, 18 Jan 1998 11:24:49 -0500
Check this out:  I have an IF structure inside a LOCAL FN that can't tell
when the value of a variable is non-zero.  It is preceded by a SELECT
structure that has a number of conditional checks, all of which work
properly, except one.  In the problem condition the values of the relevant
variables are set properly but are not recognized later on.  This is the
structure of the FN:

'...First there is a SELECT structure in which I set the values of endBar
'    (and for good measure, I set endFlag in the problem condition)

 LONG IF endBar OR endFlag
   '...do stuff
 XELSE   '...here we would expect both of them to be zero.
  LONG IF gMarket.mBegin(0)=_flatMarket   '...problem condition
   PRINT endBar,endFlag
   '...both of these print as non-zero positive values!

I've DIM'd everything properly and the structure works fine except coming
out of the one condition.  If it helps, here is the code that seems to give
the problem:

    LONG IF ABS(day.r#(i))>3
     UNTIL ABS(day.r#(endBar))<3 OR endBar=gMarket.mBegin(0)
    END IF

This sets the values of endBar and endFlag properly if I print them at the
end of the condition.  I don't change the values in any way after this.

Any help would be appreciated.  I'm really stumped on this one.

Mark Goodes (Toronto, Canada)
Much better at "OOPS!" programming than OOP programming.