[futurebasic] CALL SETCTLVALUE

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

From: Joe Kovac <locality@...>
Date: Thu, 23 Apr 1998 23:49:35 -0400
Hello All-

I was wondering if someone out there could help me understand why I can't
get SETCTLVALUE to work. I've watched the following in MacsBug, but the
ContrlVal% field never gets set (even though the GETCTLVALUE function
returns its value just fine):

CLEAR LOCAL
LOCAL FN CheckToggle (CntlH&,MousePt&)
  '---> Allocate Variables
  DIM BtnState%, CntlPart%
  '---> Convert To Local
  CALL GLOBALTOLOCAL (MousePt&)
  '---> Toggle Check Box
  LONG IF (CntlH& <> 0)
    CntlPart% = FN TRACKCONTROL (CntlH&,MousePt&,0)
    '---> Set Control
    LONG IF (CntlPart% <> 0)
      BtnState% = FN GETCTLVALUE (CntlH&)
      BtnState% = 1 - BtnState%
      CALL SETCTLVALUE (CntlH&,BtnState%)
    END IF
  END IF
END FN = BtnState%

On the other hand, when I set it manually it works like a charm:

CLEAR LOCAL
LOCAL FN CheckToggle (CntlH&,MousePt&)
  '---> Allocate Variables
  DIM BtnState%, CntlPart%
  '---> Convert To Local
  CALL GLOBALTOLOCAL (MousePt&)
  '---> Toggle Check Box
  LONG IF (CntlH& <> 0)
    CntlPart% = FN TRACKCONTROL (CntlH&,MousePt&,0)
    '---> Set Control
    LONG IF (CntlPart% <> 0)
      BtnState% = FN GETCTLVALUE (CntlH&)
      BtnState% = 1 - BtnState%
      CntlH&..contrlValue% = BtnState%
      CALL DRAW1CONTROL (CntlH&)
    END IF
  END IF
END FN = BtnState%

I tried replacing the CALLSETCTLVALUE with the assembly version from the
original header files, to make sure it wasn't an FB problem, but no luck. I
understand why the second version works, but I don't understand why the
first one won't. Any hints?

Thanks in advance,
Joe K.