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. Ahh, the joys of Visual Basic

Ahh, the joys of Visual Basic

Scheduled Pinned Locked Moved The Weird and The Wonderful
c++rubyhtmlcom
13 Posts 10 Posters 2 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.
  • A Offline
    A Offline
    Argonia
    wrote on last edited by
    #1

    Hehe finally i made my way to The Weird and The Wonderful. Enjoy! I am sitting here writing some vc++ code cloning some Dom nodes with MSXML and cloneNode(VARIANT_BOOL deep) and i noticed that the deep cloning isn't working. After some googling i found this gem

    typedef short VARIANT_BOOL;
    #define VARIANT_TRUE ((VARIANT_BOOL)-1)
    #define VARIANT_FALSE ((VARIANT_BOOL)0)

    with this explanation "This was developed by the Visual Basic folks" Clickety Microsoft... the only place where VARIANT_TRUE != true Thank you Visual Basic Team.

    M D G C 4 Replies Last reply
    0
    • A Argonia

      Hehe finally i made my way to The Weird and The Wonderful. Enjoy! I am sitting here writing some vc++ code cloning some Dom nodes with MSXML and cloneNode(VARIANT_BOOL deep) and i noticed that the deep cloning isn't working. After some googling i found this gem

      typedef short VARIANT_BOOL;
      #define VARIANT_TRUE ((VARIANT_BOOL)-1)
      #define VARIANT_FALSE ((VARIANT_BOOL)0)

      with this explanation "This was developed by the Visual Basic folks" Clickety Microsoft... the only place where VARIANT_TRUE != true Thank you Visual Basic Team.

      M Offline
      M Offline
      Mohammed Hameed
      wrote on last edited by
      #2

      Welcome to W & W :)

      http://authenticcode.com

      1 Reply Last reply
      0
      • A Argonia

        Hehe finally i made my way to The Weird and The Wonderful. Enjoy! I am sitting here writing some vc++ code cloning some Dom nodes with MSXML and cloneNode(VARIANT_BOOL deep) and i noticed that the deep cloning isn't working. After some googling i found this gem

        typedef short VARIANT_BOOL;
        #define VARIANT_TRUE ((VARIANT_BOOL)-1)
        #define VARIANT_FALSE ((VARIANT_BOOL)0)

        with this explanation "This was developed by the Visual Basic folks" Clickety Microsoft... the only place where VARIANT_TRUE != true Thank you Visual Basic Team.

        D Offline
        D Offline
        dusty_dex
        wrote on last edited by
        #3

        This isn't a Microsoft thing. BASIC is the issue. non-zero = TRUE. But it's still idiotic, and yet another reason to avoid lecacy crap such as BASIC. X|

        H 1 Reply Last reply
        0
        • A Argonia

          Hehe finally i made my way to The Weird and The Wonderful. Enjoy! I am sitting here writing some vc++ code cloning some Dom nodes with MSXML and cloneNode(VARIANT_BOOL deep) and i noticed that the deep cloning isn't working. After some googling i found this gem

          typedef short VARIANT_BOOL;
          #define VARIANT_TRUE ((VARIANT_BOOL)-1)
          #define VARIANT_FALSE ((VARIANT_BOOL)0)

          with this explanation "This was developed by the Visual Basic folks" Clickety Microsoft... the only place where VARIANT_TRUE != true Thank you Visual Basic Team.

          G Offline
          G Offline
          GuyThiebaut
          wrote on last edited by
          #4

          Yes, that always used to catch me out with VBA. The worst part was that a check box had three states - true, false and indeterminate. Guess what the indeterminate state was? Yes it was 1! :((

          “That which can be asserted without evidence, can be dismissed without evidence.”

          ― Christopher Hitchens

          A F 2 Replies Last reply
          0
          • G GuyThiebaut

            Yes, that always used to catch me out with VBA. The worst part was that a check box had three states - true, false and indeterminate. Guess what the indeterminate state was? Yes it was 1! :((

            “That which can be asserted without evidence, can be dismissed without evidence.”

            ― Christopher Hitchens

            A Offline
            A Offline
            Argonia
            wrote on last edited by
            #5

            What means a check box to the indeterminate?! Does it randomly mark it or not ? Or maybe just check it in half :confused:

            G L G 3 Replies Last reply
            0
            • A Argonia

              What means a check box to the indeterminate?! Does it randomly mark it or not ? Or maybe just check it in half :confused:

              G Offline
              G Offline
              GuyThiebaut
              wrote on last edited by
              #6

              A checkbox could be checked, not checked or have a light grey fill - the light grey fill meant indeterminate.

              “That which can be asserted without evidence, can be dismissed without evidence.”

              ― Christopher Hitchens

              1 Reply Last reply
              0
              • A Argonia

                What means a check box to the indeterminate?! Does it randomly mark it or not ? Or maybe just check it in half :confused:

                L Offline
                L Offline
                lewax00
                wrote on last edited by
                #7

                I think it's the check box that is filled in with a square. Like when you have an installer and there's a tree of options, and the root option has a check box that checks or unchecks all of the sub-options, and it turns to a square if you only check at least one but not all sub-options.

                1 Reply Last reply
                0
                • D dusty_dex

                  This isn't a Microsoft thing. BASIC is the issue. non-zero = TRUE. But it's still idiotic, and yet another reason to avoid lecacy crap such as BASIC. X|

                  H Offline
                  H Offline
                  Herbie Mountjoy
                  wrote on last edited by
                  #8

                  I think this is a legacy from the pre-BASIC days of writing everything in assembler or direct hex (or octal) code. The value of -1 for a byte of 8 bits was 1111 1111 which also means true (all bits set to 1). This seems to have percolated into VB. I agree that it doesn't seem logical these days but way back then there was no strong typing and bool didn't really exist.

                  I may not last forever but the mess I leave behind certainly will.

                  D 1 Reply Last reply
                  0
                  • G GuyThiebaut

                    Yes, that always used to catch me out with VBA. The worst part was that a check box had three states - true, false and indeterminate. Guess what the indeterminate state was? Yes it was 1! :((

                    “That which can be asserted without evidence, can be dismissed without evidence.”

                    ― Christopher Hitchens

                    F Offline
                    F Offline
                    Freak30
                    wrote on last edited by
                    #9

                    I think, the MFC (with C++) had this too, but there the value for intermediate was 2, IIRC.

                    1 Reply Last reply
                    0
                    • H Herbie Mountjoy

                      I think this is a legacy from the pre-BASIC days of writing everything in assembler or direct hex (or octal) code. The value of -1 for a byte of 8 bits was 1111 1111 which also means true (all bits set to 1). This seems to have percolated into VB. I agree that it doesn't seem logical these days but way back then there was no strong typing and bool didn't really exist.

                      I may not last forever but the mess I leave behind certainly will.

                      D Offline
                      D Offline
                      dusty_dex
                      wrote on last edited by
                      #10

                      I suspect you maybe right. something *convenient* and to do with cpu condition flags. :)

                      W 1 Reply Last reply
                      0
                      • A Argonia

                        Hehe finally i made my way to The Weird and The Wonderful. Enjoy! I am sitting here writing some vc++ code cloning some Dom nodes with MSXML and cloneNode(VARIANT_BOOL deep) and i noticed that the deep cloning isn't working. After some googling i found this gem

                        typedef short VARIANT_BOOL;
                        #define VARIANT_TRUE ((VARIANT_BOOL)-1)
                        #define VARIANT_FALSE ((VARIANT_BOOL)0)

                        with this explanation "This was developed by the Visual Basic folks" Clickety Microsoft... the only place where VARIANT_TRUE != true Thank you Visual Basic Team.

                        C Offline
                        C Offline
                        csugden
                        wrote on last edited by
                        #11

                        It really was just plain old GW-Basic, QBasic, Basic-Plus and other miscreants. Backward compatibility can backfire on occasion

                        1 Reply Last reply
                        0
                        • D dusty_dex

                          I suspect you maybe right. something *convenient* and to do with cpu condition flags. :)

                          W Offline
                          W Offline
                          Westm
                          wrote on last edited by
                          #12

                          Yep, he's correct.

                          1 Reply Last reply
                          0
                          • A Argonia

                            What means a check box to the indeterminate?! Does it randomly mark it or not ? Or maybe just check it in half :confused:

                            G Offline
                            G Offline
                            gervacleto
                            wrote on last edited by
                            #13

                            Indeterminate shows if there are sub-checkboxes belonging to this one, some of them can be checked, some unchecked. So the parent checkbox can't be 'checked' or 'unchecked' but partially-checked. ;-)

                            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