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 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:

              CPalliniC Online
              CPalliniC Online
              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]

              In testa che avete, signor di Ceprano?

              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"

                CPalliniC 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"

                  CPalliniC Online
                  CPalliniC Online
                  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]

                  In testa che avete, signor di Ceprano?

                  R 1 Reply Last reply
                  0
                  • CPalliniC 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:

                    CPalliniC 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:

                      CPalliniC Online
                      CPalliniC Online
                      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]

                      In testa che avete, signor di Ceprano?

                      R L S 3 Replies Last reply
                      0
                      • CPalliniC 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:

                        CPalliniC 1 Reply Last reply
                        0
                        • CPalliniC 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.


                          CPalliniC 1 Reply Last reply
                          0
                          • CPalliniC 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:

                              CPalliniC Online
                              CPalliniC Online
                              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]

                              In testa che avete, signor di Ceprano?

                              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.


                                CPalliniC Online
                                CPalliniC Online
                                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]

                                In testa che avete, signor di Ceprano?

                                1 Reply Last reply
                                0
                                • CPalliniC 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:

                                  CPalliniC 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:

                                    CPalliniC Online
                                    CPalliniC Online
                                    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]

                                    In testa che avete, signor di Ceprano?

                                    1 Reply Last reply
                                    0
                                    • CPalliniC 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

                                      CPalliniC 1 Reply Last reply
                                      0
                                      • S SalarSoft

                                        CPallini wrote:

                                        Unfortunately I have no VB6 at hand.

                                        You're lucky! ;P

                                        CPalliniC Online
                                        CPalliniC Online
                                        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]

                                        In testa che avete, signor di Ceprano?

                                        U 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:

                                          V Offline
                                          V Offline
                                          Vasudevan Deepak Kumar
                                          wrote on last edited by
                                          #21

                                          SalarSoft wrote:

                                          VB.NET

                                          That is why it is Very Bad.

                                          Vasudevan Deepak Kumar Personal Homepage
                                          Tech Gossips
                                          A pessimist sees only the dark side of the clouds, and mopes; a philosopher sees both sides, and shrugs; an optimist doesn't see the clouds at all - he's walking on them. --Leonard Louis Levinson

                                          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