Announcement

Collapse
No announcement yet.

And &h0000

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

  • Michael Mattias
    replied
    OR...
    Code:
    IF (dwOptions AND %A) THEN sMsg = sMsg & "A" & ","
    IF (dwOptions AND %B)  THEN...
    ==>
    Code:
    IF (dwOptions AND %A)  [COLOR="Red"]= A% [/COLOR]THEN sMsg = sMsg & "A" & ","
    IF (dwOptions AND %B) [COLOR="Red"] = B% [/COLOR]THEN .....

    Leave a comment:


  • Paul Dixon
    replied
    John,
    option %A looks like it means "none of the others" as if any other option is set then A is not so it can't be tested the way you're doing it.
    You need to use 1,2,4,8,16 instead of 0,1,2,4,8 for your masks.

    Paul.

    Leave a comment:


  • Michael Mattias
    replied
    >How can I test for &H0000 with AND?
    Code:
      if DwOptions = 0 THEN 
    ...

    Leave a comment:


  • John Thompson
    started a topic And &h0000

    And &h0000

    How can I test for &H0000 with AND?

    Code:
    #COMPILE EXE
    #DIM ALL
    
    %A = &H0000 'Without changing this value, how can I test for it below?
    %B = &H0001
    %C = &H0002
    %D = &H0004
    %E = &H0008
    
    SUB GetOptions (dwOptions AS DWORD)
    
        LOCAL sMsg AS STRING
    
        IF (dwOptions AND %A) THEN sMsg = sMsg & "A" & ","
        IF (dwOptions AND %B) THEN sMsg = sMsg & "B" & ","
        IF (dwOptions AND %C) THEN sMsg = sMsg & "C" & ","
        IF (dwOptions AND %D) THEN sMsg = sMsg & "D" & ","
        IF (dwOptions AND %E) THEN sMsg = sMsg & "E" & ","
        
        MSGBOX sMsg
    
    END SUB
    
    FUNCTION PBMAIN ( ) AS LONG
        GetOptions %A           'Blank messagebox
        GetOptions %A OR %B     '"B,"
        GetOptions %C OR %D     '"C,D,"
        GetOptions &hFFFF       '"B,C,D,E,"
    END FUNCTION
Working...
X