Quantcast
Channel: Select Case vs If ... End if
Viewing all articles
Browse latest Browse all 5

Select Case vs If ... End if

$
0
0

I am writing a function to create a concordance (list of unique words in a document) which excludes common words and offensive words.

 

I simply have a long list of If ... End If statements to detemine if the word is common or offensive:, e.g.,

 

if sWord = "and" then Return True

if sWord = "a" then Return true

 

etc.

 

It occurred to me that I read somewhere that Select Case was more efficient because the expression needs to be evaluated only once.  My question is - is that true?

 

Select Case sWord

    Case "a"

    Case "and"

 

etc.

 

Thanks.


Viewing all articles
Browse latest Browse all 5

Latest Images

Trending Articles





Latest Images