misty
(Fresh Scripter)
2004-10-15 04:37 PM
SELECT CASE with using "OR" logic?

I need to do some code like th following:

SELECT
CASE #ProductType = "Windows NT Workstation" or "Windows 2000 Professional" or "Windows XP Professional"
CASE @ProductType = (something other than the above)
ENDSELECT

Or would this be better with an "IF"? I am not sure about using "OR" and I'm also not sure about evaluating strings with the = sign. Is there a better way to do it? This is all new to me who am used to UNIX shell scripting.


maciep
(Korg Regular)
2004-10-15 04:50 PM
Re: SELECT CASE with using "OR" logic?

if that's what you are literally trying to do, check out the @inwin macro

Quote:


@InWin Operating system: 1 = Windows NT; 2 = Windows 9x





Les
(KiX Master)
2004-10-15 04:50 PM
Re: SELECT CASE with using "OR" logic?

Close, but no cigar. What an I saying... not even close.

you can use OR but you need as many = as you have OR.

CASE @ProductType = "Windows NT Workstation" or @ProductType = "Windows 2000 Professional" or @ProductType = "Windows XP Professional"
CASE 1 ;none of the above


misty
(Fresh Scripter)
2004-10-15 11:12 PM
Re: SELECT CASE with using "OR" logic?

Makes sense!