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. The Lounge
  3. Example: Why does .NET promote bad programming practices?

Example: Why does .NET promote bad programming practices?

Scheduled Pinned Locked Moved The Lounge
questioncsharpcomhelptutorial
43 Posts 25 Posters 1 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.
  • E Ennis Ray Lynch Jr

    I understand that the below is more efficient but using Exceptions as a point of logic is not acceptable! Exceptions are for unexpected things that may happen but shouldn't happen. Don't get me started about the underlying method in .NET for TryParse catching an exception. When did laziness and poor practice become a valid point of view? int userInputId; try{ userInputId = Int64.Parse(txtUser.Text); } catch{ //Not set use default userInputId = 0; }


    File Not Found

    M Offline
    M Offline
    Member 96
    wrote on last edited by
    #5

    I disagree, tryparse is very valuable in user interface programming. Or are you saying that tryparse is internally coded just to parse and catch an exception instead of validating it before parsing it without an exception.

    E 1 Reply Last reply
    0
    • M Marc Clifton

      OK, this is a more language specific post, but the VB thread below got me thinking (a bad thing, I know). For example, being able to do:

      switch(myString)
      {
      case "Hello":
      ...
      case "Goodbye":
      ...
      }

      is a perfect example of how the language promotes bad programming. The result is a case-sensitive, culture-specific, difficult to extend, and probably format specific within the context of the whole parser, implementation. Now, I personally don't feel a language should (or even can) enforce good programming practices. But a language that supports a bad practice certainly doesn't help the situation. Anyone want to contribute other examples or thoughts? Marc

      Thyme In The Country

      People are just notoriously impossible. --DavidCrow
      There's NO excuse for not commenting your code. -- John Simmons / outlaw programmer
      People who say that they will refactor their code later to make it "good" don't understand refactoring, nor the art and craft of programming. -- Josh Smith

      R Offline
      R Offline
      Rocky Moore
      wrote on last edited by
      #6

      I guess, in the example, we do not know the state of the switch string (myString). However, if myString was checked for formatting prior to the switch (such as a result from a .Split or RegEx, then it would already be in the pattern to be used. In this example, it would be case sensitive and that may be what is desired (only time I would think a person would use such code). If the coder was checking keywords and did not want case sensitivity, they would simply use lower case 'case' parameters and do a ToLower on the string prior to the switch. Personally, I do not see switching on strings as a bad thing as long as proper thought goes into the desired results.

      Rocky <>< Latest Code Blog Post: New enhancements to VS WYSIWYG! Latest Tech Blog Post: Scratch: fun for all ages for free!

      1 Reply Last reply
      0
      • M Member 96

        I disagree, tryparse is very valuable in user interface programming. Or are you saying that tryparse is internally coded just to parse and catch an exception instead of validating it before parsing it without an exception.

        E Offline
        E Offline
        Ennis Ray Lynch Jr
        wrote on last edited by
        #7

        Internally it throws an exception, I can do that! (or so I have heard)


        File Not Found

        M 1 Reply Last reply
        0
        • M Marc Clifton

          OK, this is a more language specific post, but the VB thread below got me thinking (a bad thing, I know). For example, being able to do:

          switch(myString)
          {
          case "Hello":
          ...
          case "Goodbye":
          ...
          }

          is a perfect example of how the language promotes bad programming. The result is a case-sensitive, culture-specific, difficult to extend, and probably format specific within the context of the whole parser, implementation. Now, I personally don't feel a language should (or even can) enforce good programming practices. But a language that supports a bad practice certainly doesn't help the situation. Anyone want to contribute other examples or thoughts? Marc

          Thyme In The Country

          People are just notoriously impossible. --DavidCrow
          There's NO excuse for not commenting your code. -- John Simmons / outlaw programmer
          People who say that they will refactor their code later to make it "good" don't understand refactoring, nor the art and craft of programming. -- Josh Smith

          C Offline
          C Offline
          Christopher Duncan
          wrote on last edited by
          #8

          Before .NET, there was a long running battle between Visual C++ and Visual Basic. The former had the power, but the latter had millions more users because it was easier to use and provided quicker development, at least for the first 80% of the system. It was an obvious attempt to make computer programming more accessible to people who might not be able to handle more complex languages and scenarios. And it worked. Before long, everybody and his kid sister was a software developer because they could kick out a few forms in VB, and this is the root of the prejudice against it. So, it's important to keep things in perspective. VB was not targeting the rocket science crowd who was completely immersed in "good programming." It was intended to empower anyone who could click on a mouse, and make them a programmer. Not a "good" programmer. Just a programmer. The fact that there are excellent programmers who happen to use VB is a testimony to the individual, not to the language. Oh, sorry, you were talking about .NET, right? Remember the initial comments about the battle between VB and VC++? Visual Basic won, hands down, and now it completely dominates the Windows development community. .NET was evolutionary, not revolutionary. It was simply the natural evolution of the Visual Basic IDE and development paradigm, extended to deal with the Internet. C# is nothing more than Visual Basic.NET with a different syntax, and C++ is now a completely second class citizen. The job postings in any city will verify this. In a world where the dominant development platform comes from a lineage of empowering non-programmers, I'm not sure why you would expect the languages to promote "good programming practices." It is what it is.

          Author of The Career Programmer and Unite the Tribes www.PracticalStrategyConsulting.com

          E 1 Reply Last reply
          0
          • M Marc Clifton

            OK, this is a more language specific post, but the VB thread below got me thinking (a bad thing, I know). For example, being able to do:

            switch(myString)
            {
            case "Hello":
            ...
            case "Goodbye":
            ...
            }

            is a perfect example of how the language promotes bad programming. The result is a case-sensitive, culture-specific, difficult to extend, and probably format specific within the context of the whole parser, implementation. Now, I personally don't feel a language should (or even can) enforce good programming practices. But a language that supports a bad practice certainly doesn't help the situation. Anyone want to contribute other examples or thoughts? Marc

            Thyme In The Country

            People are just notoriously impossible. --DavidCrow
            There's NO excuse for not commenting your code. -- John Simmons / outlaw programmer
            People who say that they will refactor their code later to make it "good" don't understand refactoring, nor the art and craft of programming. -- Josh Smith

            P Offline
            P Offline
            peterchen
            wrote on last edited by
            #9

            if (_tcscmp(s, _T("Hello") == 0)
            {
            ...
            }
            else if (_tcscmp(s, _T("Goodbye") == 0)
            {
            ...
            }

            A language should make good practice easy, but not stop at what is generalyl perceived a bad practice.


            Developers, Developers, Developers, Developers, Developers, Developers, Velopers, Develprs, Developers!
            We are a big screwed up dysfunctional psychotic happy family - some more screwed up, others more happy, but everybody's psychotic joint venture definition of CP
            Linkify!|Fold With Us!

            P 1 Reply Last reply
            0
            • E Ennis Ray Lynch Jr

              Internally it throws an exception, I can do that! (or so I have heard)


              File Not Found

              M Offline
              M Offline
              Member 96
              wrote on last edited by
              #10

              Really? I did not know that. Hmm..that seems like not a very good thing. I was under the assumption that it didn't throw an exception internally. Weird. I guess next chance I get I'm going to have to lookup the source for that and see. Hopefully it at least does some sanity checking without exception.

              E 1 Reply Last reply
              0
              • E Ennis Ray Lynch Jr

                I understand that the below is more efficient but using Exceptions as a point of logic is not acceptable! Exceptions are for unexpected things that may happen but shouldn't happen. Don't get me started about the underlying method in .NET for TryParse catching an exception. When did laziness and poor practice become a valid point of view? int userInputId; try{ userInputId = Int64.Parse(txtUser.Text); } catch{ //Not set use default userInputId = 0; }


                File Not Found

                J Offline
                J Offline
                Joe Woodbury
                wrote on last edited by
                #11

                This annoys me greatly as well--it one app I was working on, it caused a noticeable performance drop. I ended up rolling my own parsers that never threw exceptions (and ended up being faster with the non-exception cases as well.)

                Anyone who thinks he has a better idea of what's good for people than people do is a swine. - P.J. O'Rourke

                1 Reply Last reply
                0
                • P peterchen

                  if (_tcscmp(s, _T("Hello") == 0)
                  {
                  ...
                  }
                  else if (_tcscmp(s, _T("Goodbye") == 0)
                  {
                  ...
                  }

                  A language should make good practice easy, but not stop at what is generalyl perceived a bad practice.


                  Developers, Developers, Developers, Developers, Developers, Developers, Velopers, Develprs, Developers!
                  We are a big screwed up dysfunctional psychotic happy family - some more screwed up, others more happy, but everybody's psychotic joint venture definition of CP
                  Linkify!|Fold With Us!

                  P Offline
                  P Offline
                  Paul Watson
                  wrote on last edited by
                  #12

                  Does that even compile?

                  regards, Paul Watson Ireland & South Africa

                  Shog9 wrote:

                  And with that, Paul closed his browser, sipped his herbal tea, fixed the flower in his hair, and smiled brightly at the multitude of cute, furry animals flocking around the grassy hillside where he sat coding Ruby on his Mac...

                  G 1 Reply Last reply
                  0
                  • M Member 96

                    Really? I did not know that. Hmm..that seems like not a very good thing. I was under the assumption that it didn't throw an exception internally. Weird. I guess next chance I get I'm going to have to lookup the source for that and see. Hopefully it at least does some sanity checking without exception.

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

                    Tis true I'm afraid, I was  X| when I looked at the source with Reflector.

                    D 1 Reply Last reply
                    0
                    • C Christopher Duncan

                      Before .NET, there was a long running battle between Visual C++ and Visual Basic. The former had the power, but the latter had millions more users because it was easier to use and provided quicker development, at least for the first 80% of the system. It was an obvious attempt to make computer programming more accessible to people who might not be able to handle more complex languages and scenarios. And it worked. Before long, everybody and his kid sister was a software developer because they could kick out a few forms in VB, and this is the root of the prejudice against it. So, it's important to keep things in perspective. VB was not targeting the rocket science crowd who was completely immersed in "good programming." It was intended to empower anyone who could click on a mouse, and make them a programmer. Not a "good" programmer. Just a programmer. The fact that there are excellent programmers who happen to use VB is a testimony to the individual, not to the language. Oh, sorry, you were talking about .NET, right? Remember the initial comments about the battle between VB and VC++? Visual Basic won, hands down, and now it completely dominates the Windows development community. .NET was evolutionary, not revolutionary. It was simply the natural evolution of the Visual Basic IDE and development paradigm, extended to deal with the Internet. C# is nothing more than Visual Basic.NET with a different syntax, and C++ is now a completely second class citizen. The job postings in any city will verify this. In a world where the dominant development platform comes from a lineage of empowering non-programmers, I'm not sure why you would expect the languages to promote "good programming practices." It is what it is.

                      Author of The Career Programmer and Unite the Tribes www.PracticalStrategyConsulting.com

                      E Offline
                      E Offline
                      Ennis Ray Lynch Jr
                      wrote on last edited by
                      #14

                      Now we all know why a democracy will never work. (before I get totally flamed anyone that thinks the U.S. was ever a democracy should have failed civics)


                      File Not Found

                      1 Reply Last reply
                      0
                      • M Marc Clifton

                        OK, this is a more language specific post, but the VB thread below got me thinking (a bad thing, I know). For example, being able to do:

                        switch(myString)
                        {
                        case "Hello":
                        ...
                        case "Goodbye":
                        ...
                        }

                        is a perfect example of how the language promotes bad programming. The result is a case-sensitive, culture-specific, difficult to extend, and probably format specific within the context of the whole parser, implementation. Now, I personally don't feel a language should (or even can) enforce good programming practices. But a language that supports a bad practice certainly doesn't help the situation. Anyone want to contribute other examples or thoughts? Marc

                        Thyme In The Country

                        People are just notoriously impossible. --DavidCrow
                        There's NO excuse for not commenting your code. -- John Simmons / outlaw programmer
                        People who say that they will refactor their code later to make it "good" don't understand refactoring, nor the art and craft of programming. -- Josh Smith

                        P Offline
                        P Offline
                        Paul Watson
                        wrote on last edited by
                        #15

                        'cause it is useful when you need it to get a quick job done. There is a lot to be said about premature optimisation and astronaut architects.

                        regards, Paul Watson Ireland & South Africa

                        Shog9 wrote:

                        And with that, Paul closed his browser, sipped his herbal tea, fixed the flower in his hair, and smiled brightly at the multitude of cute, furry animals flocking around the grassy hillside where he sat coding Ruby on his Mac...

                        D S C 3 Replies Last reply
                        0
                        • P Paul Watson

                          Does that even compile?

                          regards, Paul Watson Ireland & South Africa

                          Shog9 wrote:

                          And with that, Paul closed his browser, sipped his herbal tea, fixed the flower in his hair, and smiled brightly at the multitude of cute, furry animals flocking around the grassy hillside where he sat coding Ruby on his Mac...

                          G Offline
                          G Offline
                          Gary Wheeler
                          wrote on last edited by
                          #16

                          He missed a couple right parentheses ')'. I dare you to put a message in the Suggestions forum asking Chris for a C++ syntax checker in the post submission gizmo :-D.


                          Software Zen: delete this;

                          P 1 Reply Last reply
                          0
                          • M Marc Clifton

                            OK, this is a more language specific post, but the VB thread below got me thinking (a bad thing, I know). For example, being able to do:

                            switch(myString)
                            {
                            case "Hello":
                            ...
                            case "Goodbye":
                            ...
                            }

                            is a perfect example of how the language promotes bad programming. The result is a case-sensitive, culture-specific, difficult to extend, and probably format specific within the context of the whole parser, implementation. Now, I personally don't feel a language should (or even can) enforce good programming practices. But a language that supports a bad practice certainly doesn't help the situation. Anyone want to contribute other examples or thoughts? Marc

                            Thyme In The Country

                            People are just notoriously impossible. --DavidCrow
                            There's NO excuse for not commenting your code. -- John Simmons / outlaw programmer
                            People who say that they will refactor their code later to make it "good" don't understand refactoring, nor the art and craft of programming. -- Josh Smith

                            C Offline
                            C Offline
                            Chris Losinger
                            wrote on last edited by
                            #17

                            Marc Clifton wrote:

                            The result is a case-sensitive, culture-specific, difficult to extend, and probably format specific within the context of the whole parser, implementation.

                            if the strings are limited to a small set of pre-defined values, none of that matters. in that case, the only thing separating that from a numeric switch is the cost of a string compare vs a simple numeric compare. and it might be acceptable to pay that price.

                            image processing toolkits | batch image processing | blogging

                            1 Reply Last reply
                            0
                            • G Gary Wheeler

                              He missed a couple right parentheses ')'. I dare you to put a message in the Suggestions forum asking Chris for a C++ syntax checker in the post submission gizmo :-D.


                              Software Zen: delete this;

                              P Offline
                              P Offline
                              peterchen
                              wrote on last edited by
                              #18

                              Spent all the day crunching out specs... My coding skills deteriorate quickly.


                              Developers, Developers, Developers, Developers, Developers, Developers, Velopers, Develprs, Developers!
                              We are a big screwed up dysfunctional psychotic happy family - some more screwed up, others more happy, but everybody's psychotic joint venture definition of CP
                              Linkify!|Fold With Us!

                              1 Reply Last reply
                              0
                              • M Marc Clifton

                                OK, this is a more language specific post, but the VB thread below got me thinking (a bad thing, I know). For example, being able to do:

                                switch(myString)
                                {
                                case "Hello":
                                ...
                                case "Goodbye":
                                ...
                                }

                                is a perfect example of how the language promotes bad programming. The result is a case-sensitive, culture-specific, difficult to extend, and probably format specific within the context of the whole parser, implementation. Now, I personally don't feel a language should (or even can) enforce good programming practices. But a language that supports a bad practice certainly doesn't help the situation. Anyone want to contribute other examples or thoughts? Marc

                                Thyme In The Country

                                People are just notoriously impossible. --DavidCrow
                                There's NO excuse for not commenting your code. -- John Simmons / outlaw programmer
                                People who say that they will refactor their code later to make it "good" don't understand refactoring, nor the art and craft of programming. -- Josh Smith

                                R Offline
                                R Offline
                                Ray Cassick
                                wrote on last edited by
                                #19

                                Although I tend to try to stay away form case statements that are on anything other than numbers (or enums as the case may also be) I can see where that would have it usefulness. It is difficult, as it is in any syntactical/grammatical base question, to say outright if it is 'wrong' without some surrounding context. I will admit that I have done somewhat similar things in cases where I asked the user to verify with an exact text string that they want to do something (IE: delete a record form a database). Of course once again you have to put it into context. My app was not going to be used outside the company so I had no language/culture problems to deal with that would have made string comparisons a problem. It was a simple solution to a very narrow problem.


                                My Blog[^]
                                FFRF[^]


                                1 Reply Last reply
                                0
                                • M Marc Clifton

                                  OK, this is a more language specific post, but the VB thread below got me thinking (a bad thing, I know). For example, being able to do:

                                  switch(myString)
                                  {
                                  case "Hello":
                                  ...
                                  case "Goodbye":
                                  ...
                                  }

                                  is a perfect example of how the language promotes bad programming. The result is a case-sensitive, culture-specific, difficult to extend, and probably format specific within the context of the whole parser, implementation. Now, I personally don't feel a language should (or even can) enforce good programming practices. But a language that supports a bad practice certainly doesn't help the situation. Anyone want to contribute other examples or thoughts? Marc

                                  Thyme In The Country

                                  People are just notoriously impossible. --DavidCrow
                                  There's NO excuse for not commenting your code. -- John Simmons / outlaw programmer
                                  People who say that they will refactor their code later to make it "good" don't understand refactoring, nor the art and craft of programming. -- Josh Smith

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

                                  Marc Clifton wrote:

                                  Now, I personally don't feel a language should (or even can) enforce good programming practices. But a language that supports a bad practice certainly doesn't help the situation.

                                  Yeah, but I really like of the freedom of choice.

                                  Marc Clifton wrote:

                                  Anyone want to contribute other examples or thoughts?

                                  Once I have suggested in MSDN Feedback Center this language improvement (in bold):

                                  for(int i=0; i<10; i++) as externalFor
                                  {
                                  for(int j=0; j<10; j++) as middleFor
                                  {
                                  for(int k=0; j<10; k++) as innerFor
                                  {
                                  if (someCondition)
                                  {
                                  break middleFor;
                                  }
                                  if (anotherCondition)
                                  {
                                  continue externalFor;
                                  }
                                  }
                                  }
                                  }

                                  and they told me to use goto statements... X|


                                  Engaged in learning of English grammar ;)
                                  For God so loved the world, that he gave his only begotten Son, that whosoever believeth in him should not perish, but have everlasting life.(John 3:16) :badger:

                                  1 Reply Last reply
                                  0
                                  • P Paul Watson

                                    'cause it is useful when you need it to get a quick job done. There is a lot to be said about premature optimisation and astronaut architects.

                                    regards, Paul Watson Ireland & South Africa

                                    Shog9 wrote:

                                    And with that, Paul closed his browser, sipped his herbal tea, fixed the flower in his hair, and smiled brightly at the multitude of cute, furry animals flocking around the grassy hillside where he sat coding Ruby on his Mac...

                                    D Offline
                                    D Offline
                                    DavidNohejl
                                    wrote on last edited by
                                    #21

                                    Phrase "astronaut architects" is not known to be, but I think I agree :) Using TryParse when dealing with user input is usually sufficient. If TryParse methods are not fast enough, by all means implement yours. edit: oops, didn't see you responded to original post and not TryParse debate above. Well, surprisingly my post didn't lost its meaning. :->


                                    "Throughout human history, we have been dependent on machines to survive. Fate, it seems, is not without a sense of irony. " - Morpheus

                                    P 1 Reply Last reply
                                    0
                                    • E Ed Poore

                                      Tis true I'm afraid, I was  X| when I looked at the source with Reflector.

                                      D Offline
                                      D Offline
                                      DavidNohejl
                                      wrote on last edited by
                                      #22

                                      Interesting, this is what my Reflector shows: private static bool TryStringToNumber(string str, NumberStyles options, ref Number.NumberBuffer number, NumberFormatInfo numfmt, bool parseDecimal);

                                        if (!Number.ParseNumber(ref chPtr2, options, ref number, numfmt, parseDecimal) 
                                              || ((((long) ((chPtr2 - chPtr1) / 2)) < str.Length)
                                              && !Number.TrailingZeros(str, (int) ((long) ((chPtr2 - chPtr1) / 2)))))
                                                  {
                                                        return false;
                                                  }
                                      

                                      private static void StringToNumber(string str, NumberStyles options, ref Number.NumberBuffer number, NumberFormatInfo info, bool parseDecimal);

                                            if (!Number.ParseNumber(ref chPtr2, options, ref number, info, parseDecimal) 
                                             || ((((long) ((chPtr2 - chPtr1) / 2)) < str.Length) 
                                             && !Number.TrailingZeros(str, (int) ((long) ((chPtr2 - chPtr1) / 2)))))
                                                  {
                                                        throw new FormatException(Environment.GetResourceString("Format_InvalidString"));
                                                  }
                                      

                                      "Throughout human history, we have been dependent on machines to survive. Fate, it seems, is not without a sense of irony. " - Morpheus

                                      E 1 Reply Last reply
                                      0
                                      • M Marc Clifton

                                        OK, this is a more language specific post, but the VB thread below got me thinking (a bad thing, I know). For example, being able to do:

                                        switch(myString)
                                        {
                                        case "Hello":
                                        ...
                                        case "Goodbye":
                                        ...
                                        }

                                        is a perfect example of how the language promotes bad programming. The result is a case-sensitive, culture-specific, difficult to extend, and probably format specific within the context of the whole parser, implementation. Now, I personally don't feel a language should (or even can) enforce good programming practices. But a language that supports a bad practice certainly doesn't help the situation. Anyone want to contribute other examples or thoughts? Marc

                                        Thyme In The Country

                                        People are just notoriously impossible. --DavidCrow
                                        There's NO excuse for not commenting your code. -- John Simmons / outlaw programmer
                                        People who say that they will refactor their code later to make it "good" don't understand refactoring, nor the art and craft of programming. -- Josh Smith

                                        realJSOPR Offline
                                        realJSOPR Offline
                                        realJSOP
                                        wrote on last edited by
                                        #23

                                        Of course, if case isn't an issue, you could just do the equivalent of MFC's MakeUpper() or MakeLower() and then run through your switch statement. However, that does not address the issue of language unless you can put the strings into a resource file or something, but then you'd be able to run your switch on integers instead of text. Still, having a switch statement for text is the next best thing to stupid I've seen in a long time.

                                        "Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997
                                        -----
                                        "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001

                                        C 1 Reply Last reply
                                        0
                                        • realJSOPR realJSOP

                                          Of course, if case isn't an issue, you could just do the equivalent of MFC's MakeUpper() or MakeLower() and then run through your switch statement. However, that does not address the issue of language unless you can put the strings into a resource file or something, but then you'd be able to run your switch on integers instead of text. Still, having a switch statement for text is the next best thing to stupid I've seen in a long time.

                                          "Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997
                                          -----
                                          "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001

                                          C Offline
                                          C Offline
                                          Chris Losinger
                                          wrote on last edited by
                                          #24

                                          John Simmons / outlaw programmer wrote:

                                          unless you can put the strings into a resource file or something, but then you'd be able to run your switch on integers instead of text.

                                          not if, for example, those strings are coming from database records, and there's no numeric equivalent in the record (so you can't just use the number instead of the string), and there's no way you can change the DB schema (because too many things would break). you can do a string compare on each record and generate a numeric code to carry around along with the recordset, to use that in your switch statements. but that just moves the string compare - it doesn't eliminate it. sometimes the best you can do is Make It Work.

                                          image processing toolkits | batch image processing | blogging

                                          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