IF vs. select Case

Results 1 to 4 of 4

Thread: IF vs. select Case

  1. #1
    Join Date
    Dec 1969

    Default IF vs. select Case

    Is one better then the other? Use less resources or anything like that. Or are basically the exact same just different ways?<BR>Thanks<BR><BR>GET WELL BILL

  2. #2
    Eddie Campbell Guest

    Default RE: IF vs. select Case

    If you only have 1 thing to test always use an If statement. If you are testing for a number of conditions, a Select may be more efficient. When you use multiple If statements, they are ALL tested whereas with a Select, once a true condition is found, the rest of the tests are skipped.

  3. #3
    Join Date
    Dec 1969

    Default RE: IF vs. select Case

    OK, but what if you use IF and ELSEIF... shouldn&#039;t be the same?

  4. #4
    genzo Guest

    Default RE: IF vs. select Case

    if the previous post was right then the select case would not bother to process other conditions if a case was found, but elseif&#039;s would carry on looking 4 other conditions.<BR><BR>i personally use select case if my elseif&#039;s go beyond about 3 0r 4 conditions, but only &#039;coz i find them easier to look at than loads of nested stuff

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts