Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Other Discussions
  3. The Weird and The Wonderful
  4. Bit operations in VBScript

Bit operations in VBScript

Scheduled Pinned Locked Moved The Weird and The Wonderful
c++comarchitecture
5 Posts 5 Posters 20 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • C Offline
    C Offline
    Chris Maunder
    wrote on last edited by
    #1

    Let me start with one of my own from my days when I either didn't understand or didn't trust VBScript

    Function TestBit(Value, Bit)
    TestBit = ((CLng(Value) And CLng(Bit)) > 0)
    End Function

    All I'll say is that I was young and foolish.

    cheers, Chris Maunder

    CodeProject.com : C++ MVP

    E S D 3 Replies Last reply
    0
    • C Chris Maunder

      Let me start with one of my own from my days when I either didn't understand or didn't trust VBScript

      Function TestBit(Value, Bit)
      TestBit = ((CLng(Value) And CLng(Bit)) > 0)
      End Function

      All I'll say is that I was young and foolish.

      cheers, Chris Maunder

      CodeProject.com : C++ MVP

      E Offline
      E Offline
      Ed Poore
      wrote on last edited by
      #2

      Chris Maunder wrote:

      didn't understand

      Most likely since I've seen this code in C, C#, VB...

      1 Reply Last reply
      0
      • C Chris Maunder

        Let me start with one of my own from my days when I either didn't understand or didn't trust VBScript

        Function TestBit(Value, Bit)
        TestBit = ((CLng(Value) And CLng(Bit)) > 0)
        End Function

        All I'll say is that I was young and foolish.

        cheers, Chris Maunder

        CodeProject.com : C++ MVP

        S Offline
        S Offline
        Shog9 0
        wrote on last edited by
        #3

        Chris Maunder wrote:

        didn't trust VBScript

        Can hardly blame you there... damn context-sensitive "and"s...

        ----

        It appears that everybody is under the impression that I approve of the documentation. You probably also blame Ken Burns for supporting slavery.

        --Raymond Chen on MSDN

        1 Reply Last reply
        0
        • C Chris Maunder

          Let me start with one of my own from my days when I either didn't understand or didn't trust VBScript

          Function TestBit(Value, Bit)
          TestBit = ((CLng(Value) And CLng(Bit)) > 0)
          End Function

          All I'll say is that I was young and foolish.

          cheers, Chris Maunder

          CodeProject.com : C++ MVP

          D Offline
          D Offline
          David Rush
          wrote on last edited by
          #4

          That reminds me of a previous boss who made us initialize all C++ pointers to null TWICE (just to make sure)

          L 1 Reply Last reply
          0
          • D David Rush

            That reminds me of a previous boss who made us initialize all C++ pointers to null TWICE (just to make sure)

            L Offline
            L Offline
            Lutoslaw
            wrote on last edited by
            #5

            "pointer = null; pointer = null;"? Well... very interesting. However, I suppose it doesn't make the problem solved. I would rather use: "while (pointer != null) pointer = null;"

            1 Reply Last reply
            0
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            • Login

            • Don't have an account? Register

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • World
            • Users
            • Groups