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. Professional conditions with IF

Professional conditions with IF

Scheduled Pinned Locked Moved The Weird and The Wonderful
csharphelpquestion
26 Posts 13 Posters 0 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.
  • S Offline
    S Offline
    SalarSoft
    wrote on last edited by
    #1

    One of our former staff wrote this professional IF clause in VB.NET(Hell language) IF TextBox1.Text=1 or 2 or 3 THEN ' Go to hell END IF :wtf: I tried to write codes like this, but couldn't. Can you help to write? :omg:

    L R U C J 6 Replies Last reply
    0
    • S SalarSoft

      One of our former staff wrote this professional IF clause in VB.NET(Hell language) IF TextBox1.Text=1 or 2 or 3 THEN ' Go to hell END IF :wtf: I tried to write codes like this, but couldn't. Can you help to write? :omg:

      L Offline
      L Offline
      Lost User
      wrote on last edited by
      #2

      :-D well it could be worse.. i mean he could have written IF TextBox1=1 or 2 or 3 THEN TextBox2 = TextBox1 * 10 ' more ugly code here... END IF i don't know if this works with vb.net as well but in vb6 it definitly did :)

      1 Reply Last reply
      0
      • S SalarSoft

        One of our former staff wrote this professional IF clause in VB.NET(Hell language) IF TextBox1.Text=1 or 2 or 3 THEN ' Go to hell END IF :wtf: I tried to write codes like this, but couldn't. Can you help to write? :omg:

        R Offline
        R Offline
        Rich Insley
        wrote on last edited by
        #3

        It's not uncommon at all to see coders express their frustrations in the code they write. For an entertaining afternoon of reading, go to http://www.google.com/codesearch[^] and enter the profanity of your choice. You'd be amazed what people say.

        L J P T 4 Replies Last reply
        0
        • R Rich Insley

          It's not uncommon at all to see coders express their frustrations in the code they write. For an entertaining afternoon of reading, go to http://www.google.com/codesearch[^] and enter the profanity of your choice. You'd be amazed what people say.

          L Offline
          L Offline
          Lost User
          wrote on last edited by
          #4

          You have just supplied me with an infinitely amusing resource. thank you. (the sad part is that I probably find it so amusing because I do the same thing in all of my code)

          www.socoder.net

          1 Reply Last reply
          0
          • S SalarSoft

            One of our former staff wrote this professional IF clause in VB.NET(Hell language) IF TextBox1.Text=1 or 2 or 3 THEN ' Go to hell END IF :wtf: I tried to write codes like this, but couldn't. Can you help to write? :omg:

            U Offline
            U Offline
            unrealweapon
            wrote on last edited by
            #5

            is your former staff in hell now ? LOL

            S 1 Reply Last reply
            0
            • U unrealweapon

              is your former staff in hell now ? LOL

              S Offline
              S Offline
              SalarSoft
              wrote on last edited by
              #6

              I saw her with her husband. I think she is in hell now. YES! She is a woman!

              1 Reply Last reply
              0
              • S SalarSoft

                One of our former staff wrote this professional IF clause in VB.NET(Hell language) IF TextBox1.Text=1 or 2 or 3 THEN ' Go to hell END IF :wtf: I tried to write codes like this, but couldn't. Can you help to write? :omg:

                C Offline
                C Offline
                CPallini
                wrote on last edited by
                #7

                Did you sack her for?

                If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.
                [my articles]

                S 1 Reply Last reply
                0
                • S SalarSoft

                  One of our former staff wrote this professional IF clause in VB.NET(Hell language) IF TextBox1.Text=1 or 2 or 3 THEN ' Go to hell END IF :wtf: I tried to write codes like this, but couldn't. Can you help to write? :omg:

                  J Offline
                  J Offline
                  jhwurmbach
                  wrote on last edited by
                  #8

                  SalarSoft wrote:

                  IF TextBox1.Text=1 or 2 or 3 THEN

                  Being VB illiterate... This does work as I fear it does? It sets the TextBox1.text to be "1" and then branches into the THEN, because 2 is equal to TRUE?

                  Let's think the unthinkable, let's do the undoable, let's prepare to grapple with the ineffable itself, and see if we may not eff it after all.
                  Douglas Adams, "Dirk Gently's Holistic Detective Agency"

                  C 1 Reply Last reply
                  0
                  • J jhwurmbach

                    SalarSoft wrote:

                    IF TextBox1.Text=1 or 2 or 3 THEN

                    Being VB illiterate... This does work as I fear it does? It sets the TextBox1.text to be "1" and then branches into the THEN, because 2 is equal to TRUE?

                    Let's think the unthinkable, let's do the undoable, let's prepare to grapple with the ineffable itself, and see if we may not eff it after all.
                    Douglas Adams, "Dirk Gently's Holistic Detective Agency"

                    C Offline
                    C Offline
                    CPallini
                    wrote on last edited by
                    #9

                    jhwurmbach wrote:

                    It sets the TextBox1.text to be "1"

                    Nope. Since it follows the IF statement, VB evaluates TextBox1.Text=1 as a conditional expression (I don't know if it results in a run-time error).

                    jhwurmbach wrote:

                    and then branches into the THEN, because 2 is equal to TRUE?

                    Yes. :)

                    If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.
                    [my articles]

                    R 1 Reply Last reply
                    0
                    • C CPallini

                      jhwurmbach wrote:

                      It sets the TextBox1.text to be "1"

                      Nope. Since it follows the IF statement, VB evaluates TextBox1.Text=1 as a conditional expression (I don't know if it results in a run-time error).

                      jhwurmbach wrote:

                      and then branches into the THEN, because 2 is equal to TRUE?

                      Yes. :)

                      If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.
                      [my articles]

                      R Offline
                      R Offline
                      Robert Royall
                      wrote on last edited by
                      #10

                      CPallini wrote:

                      (I don't know if it results in a run-time error)

                      It shouldn't; nearly all flavors of VB automatically coerce numerics into strings.

                      Please don't bother me... I'm hacking right now. Don't look at me like that - doesn't anybody remember what "hacking" really means? :sigh:

                      C 1 Reply Last reply
                      0
                      • R Robert Royall

                        CPallini wrote:

                        (I don't know if it results in a run-time error)

                        It shouldn't; nearly all flavors of VB automatically coerce numerics into strings.

                        Please don't bother me... I'm hacking right now. Don't look at me like that - doesn't anybody remember what "hacking" really means? :sigh:

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

                        Robert Royall wrote:

                        It shouldn't; nearly all flavors of VB automatically coerce numerics into strings.

                        I was quite confident about too, but my VBA actually doesn't like the mix. Unfortunately I have no VB6 at hand. :)

                        If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.
                        [my articles]

                        R L S 3 Replies Last reply
                        0
                        • C CPallini

                          Robert Royall wrote:

                          It shouldn't; nearly all flavors of VB automatically coerce numerics into strings.

                          I was quite confident about too, but my VBA actually doesn't like the mix. Unfortunately I have no VB6 at hand. :)

                          If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.
                          [my articles]

                          R Offline
                          R Offline
                          Robert Royall
                          wrote on last edited by
                          #12

                          Really? Works fine for me in Access 2003. It will throw an error if Textbox1 is empty, since you can't coerce a comparison with an empty string (or a null).

                          Please don't bother me... I'm hacking right now. Don't look at me like that - doesn't anybody remember what "hacking" really means? :sigh:

                          C 1 Reply Last reply
                          0
                          • C CPallini

                            Robert Royall wrote:

                            It shouldn't; nearly all flavors of VB automatically coerce numerics into strings.

                            I was quite confident about too, but my VBA actually doesn't like the mix. Unfortunately I have no VB6 at hand. :)

                            If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.
                            [my articles]

                            L Offline
                            L Offline
                            Luc Pattyn
                            wrote on last edited by
                            #13

                            CPallini wrote:

                            Unfortunately I have no VB6 at hand

                            Unfortunately X|

                            Luc Pattyn [Forum Guidelines] [My Articles]


                            This month's tips: - before you ask a question here, search CodeProject, then Google; - the quality and detail of your question reflects on the effectiveness of the help you are likely to get; - use PRE tags to preserve formatting when showing multi-line code snippets.


                            C 1 Reply Last reply
                            0
                            • C CPallini

                              Did you sack her for?

                              If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.
                              [my articles]

                              S Offline
                              S Offline
                              SalarSoft
                              wrote on last edited by
                              #14

                              No, we deported her and her friend cause they didn't skilled and they did lots of such mistakes ( I remember their nightmare creatures ). For example she named a function to something like this "girgo". X| Because of this naming, my friends named her "girgo". :laugh: Now the corporation focused on C#

                              1 Reply Last reply
                              0
                              • R Robert Royall

                                Really? Works fine for me in Access 2003. It will throw an error if Textbox1 is empty, since you can't coerce a comparison with an empty string (or a null).

                                Please don't bother me... I'm hacking right now. Don't look at me like that - doesn't anybody remember what "hacking" really means? :sigh:

                                C Offline
                                C Offline
                                CPallini
                                wrote on last edited by
                                #15

                                Robert Royall wrote:

                                Really?

                                Yes.

                                Robert Royall wrote:

                                Works fine for me in Access 2003.

                                I'm using Excel 2002. But I think that VBA version difference doesn't really matter in this case.

                                Robert Royall wrote:

                                It will throw an error if Textbox1 is empty, since you can't coerce a comparison with an empty string (or a null).

                                IMHO it will NOT throw only if the Textbox1.Text value can be coerced to a number (i.e. Runtime Error if Textbox1.Text is equal to "foo"). :)

                                If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.
                                [my articles]

                                R 1 Reply Last reply
                                0
                                • L Luc Pattyn

                                  CPallini wrote:

                                  Unfortunately I have no VB6 at hand

                                  Unfortunately X|

                                  Luc Pattyn [Forum Guidelines] [My Articles]


                                  This month's tips: - before you ask a question here, search CodeProject, then Google; - the quality and detail of your question reflects on the effectiveness of the help you are likely to get; - use PRE tags to preserve formatting when showing multi-line code snippets.


                                  C Offline
                                  C Offline
                                  CPallini
                                  wrote on last edited by
                                  #16

                                  In fact I like a lot of weird things... ;)

                                  If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.
                                  [my articles]

                                  1 Reply Last reply
                                  0
                                  • C CPallini

                                    Robert Royall wrote:

                                    Really?

                                    Yes.

                                    Robert Royall wrote:

                                    Works fine for me in Access 2003.

                                    I'm using Excel 2002. But I think that VBA version difference doesn't really matter in this case.

                                    Robert Royall wrote:

                                    It will throw an error if Textbox1 is empty, since you can't coerce a comparison with an empty string (or a null).

                                    IMHO it will NOT throw only if the Textbox1.Text value can be coerced to a number (i.e. Runtime Error if Textbox1.Text is equal to "foo"). :)

                                    If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.
                                    [my articles]

                                    R Offline
                                    R Offline
                                    Robert Royall
                                    wrote on last edited by
                                    #17

                                    CPallini wrote:

                                    Runtime Error if Textbox1.Text is equal to "foo"

                                    But... why on earth would that throw a Runtime Error? F00 is 3840... :wtf:

                                    Please don't bother me... I'm hacking right now. Don't look at me like that - doesn't anybody remember what "hacking" really means? :sigh:

                                    C 1 Reply Last reply
                                    0
                                    • R Robert Royall

                                      CPallini wrote:

                                      Runtime Error if Textbox1.Text is equal to "foo"

                                      But... why on earth would that throw a Runtime Error? F00 is 3840... :wtf:

                                      Please don't bother me... I'm hacking right now. Don't look at me like that - doesn't anybody remember what "hacking" really means? :sigh:

                                      C Offline
                                      C Offline
                                      CPallini
                                      wrote on last edited by
                                      #18

                                      Because VB isn't such smart on number representations :-D

                                      If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.
                                      [my articles]

                                      1 Reply Last reply
                                      0
                                      • C CPallini

                                        Robert Royall wrote:

                                        It shouldn't; nearly all flavors of VB automatically coerce numerics into strings.

                                        I was quite confident about too, but my VBA actually doesn't like the mix. Unfortunately I have no VB6 at hand. :)

                                        If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.
                                        [my articles]

                                        S Offline
                                        S Offline
                                        SalarSoft
                                        wrote on last edited by
                                        #19

                                        CPallini wrote:

                                        Unfortunately I have no VB6 at hand.

                                        You're lucky! ;P

                                        C 1 Reply Last reply
                                        0
                                        • S SalarSoft

                                          CPallini wrote:

                                          Unfortunately I have no VB6 at hand.

                                          You're lucky! ;P

                                          C Offline
                                          C Offline
                                          CPallini
                                          wrote on last edited by
                                          #20

                                          Nope. http://www.codeproject.com/script/Forums/View.aspx?fid=392254&msg=2393634[^] :-D

                                          If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.
                                          [my articles]

                                          U 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