K
Kululu17
Guest
Hi - a syntax question: Is there a way to list several items following an if statement?
I would like something like:
if global.Colony_Database[(Colony_Nr),COL_Behavior] == ("Trading" or "Adjusting" or "Advanced" or "Specializing") {do stuff}
But this is not proper syntax. The correct way of doing this is:
if global.Colony_Database[(Colony_Nr),COL_Behavior] == "Trading" or global.Colony_Database[(Colony_Nr),COL_Behavior] == "Adjusting" or blabla
However doing this ends up with a line of code so long it goes off the end of the page. I could use a switch statement, but then you have many lines of code. Is there a shorthand notation for this logic? It's a simple logic, and I was hoping to accomplish it in a short piece of code. Thanks!
I would like something like:
if global.Colony_Database[(Colony_Nr),COL_Behavior] == ("Trading" or "Adjusting" or "Advanced" or "Specializing") {do stuff}
But this is not proper syntax. The correct way of doing this is:
if global.Colony_Database[(Colony_Nr),COL_Behavior] == "Trading" or global.Colony_Database[(Colony_Nr),COL_Behavior] == "Adjusting" or blabla
However doing this ends up with a line of code so long it goes off the end of the page. I could use a switch statement, but then you have many lines of code. Is there a shorthand notation for this logic? It's a simple logic, and I was hoping to accomplish it in a short piece of code. Thanks!