Announcement

Collapse
No announcement yet.

Strange bug in if statement

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Strange bug in if statement

    somewhere in my code I try to use:
    if (bit1:=1) Aan:="aan";else Aan:="uit";endif txt_MoveCursor(10,20); putnum(BIN,bit1);
    This doesn't work strangely enough. When if (bit1:=1) it always returns true, and when I put there if (bit1:=0) it always returns false.Thats why I checked in above with the putnum. The result on my screen is when I put if (bit1:=1) then bit1 returns 1, and when I put if (bit1:=0) then bit1 returns 0.
    Shouldn't work that way right?What is happening here?I altered my code in various ways with different if statements, but the problem is there to stay it seems.

  • #2


    bit1:=1 is an assignment (makes bit1 value = 1)
    You want if (bit1==1)
    _______________
    Best Regards,
    Howard

    Comment


    • #3


      Ah.Hmmm.Thanks.That helps!

      Comment

      Working...
      X