Results 1 to 2 of 2

Thread: keydown Q

  1. #1

    Thread Starter
    New Member
    Join Date
    Apr 2000
    Posts
    11

    Question Mouse down question: pl help

    Hi all!
    What is the difference between these two codes?

    Both Under Mousedown event:
    1.)

    If Shift=vbctrlmask then
    Msgbox "Mouse and Ctrl Key down"
    end if

    2.)

    If (Shift And Shift=vbctrlmask) then
    Msgbox "Mouse and Ctrl Key down"
    end if

    For me, it seems both do the same operation. Then why that diff?

    Thanx 4 the Reply.
    Calm Indian.

  2. #2
    transcendental analytic kedaman's Avatar
    Join Date
    Mar 2000
    Location
    0x002F2EA8
    Posts
    7,221

    Wink

    = operator returns true(-1) if both sides are matched
    And operator returns a bitcomparation between both sides
    If will go when you have the value <>0 which is whether when you use and or not because and will only add what shift is resulting in no change in the boolean that if needs. You have no need of that and this time.
    Use
    writing software in C++ is like driving rivets into steel beam with a toothpick.
    writing haskell makes your life easier:
    reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
    To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width