Computer Science Canada

How to make and if statement where 2 choices apply. if ontarioName = "ontario" or "Ontario".

Author:  pcmang [ Sat Jan 17, 2009 1:30 pm ]
Post subject:  How to make and if statement where 2 choices apply. if ontarioName = "ontario" or "Ontario".

when i type if ontarioName = "ontario" or "Ontario" then...
i get an error.

Author:  DanielG [ Sat Jan 17, 2009 1:32 pm ]
Post subject:  RE:How to make and if statement where 2 choices apply. if ontarioName = "ontario" or "Ontario".

well, if you only want it to work regardless of lower or uppercase then you can convert it to lower or upper case in the if statement (I believe turing has a built in function for that). However, if you want it to work just for these 2 cases then you need

code:

if ontarioName = "ontario" or ontarioName = "Ontario then

Author:  pcmang [ Sat Jan 17, 2009 2:07 pm ]
Post subject:  Re: How to make and if statement where 2 choices apply. if ontarioName = "ontario" or "Ontario".

Thanks. That helped.

Author:  [Gandalf] [ Sun Jan 18, 2009 6:54 am ]
Post subject:  RE:How to make and if statement where 2 choices apply. if ontarioName = "ontario" or "Ontario".

Alternatively, you could condense your if statement into:
code:
if Str.Lower(ontarioName) = "ontario" then


: