Switch statement for George?

A forum dedicated to George scripting questions
Post Reply
User avatar
Jeremy Richard
Posts: 51
Joined: 16 Oct 2021, 01:44
Contact:

Switch statement for George?

Post by Jeremy Richard »

Is there an equivalent to a php switch statement in George?

So instead of this:

Code: Select all

IF colour_choice == 1 || colour_choice == 2 || colour_choice == 3
	...
END
We could do:

Code: Select all

SWITCH (colour_choice) {
    CASE 1
        ...
        BREAK
    CASE 2
        ...
        BREAK
    CASE 3
        ...
        BREAK
}
or:

Code: Select all

SWITCH (colour_choice) {
    CASE 1
        ...
        BREAK
    CASE 2
    CASE 3
        ...
        BREAK
}
Post Reply