Community
SCI Programming => SCI Development Tools => Topic started by: gumby on April 30, 2012, 10:10:57 PM
-
I don't expect anyone else to hit this limitation, but the implementation of the 'switch' statement in SCI Studio only supports up to 48 case statements within it.
-
Have you found a limit in Companion?
-
I'll check. May have also been a character limit I hit within a switch statement, rather than the number of cases within it.
-
For Studio, it's definitely the number of case statements in a switch - 48. It won't even compile the script. Companion doesn't have any obvious limit, I went over 1000 case statements within a switch & it happily compiled it.
-
I think most have turned to Companion for similar reasons.
-
If I remember correctly, studio won't compile more than 12 succesfully. It acts like it does but run time is a different story. Companion is the way to go when it comes to switch cases. This was one of my first problems I ran into back in the day with Spongebob adventurepants... Studio won't even think about compiling the black cauldron because of all the case statements in the inventory script.
-
In my instance, I can get away with just using if statements instead (each case resulted in a return, so I don't need nested if/else logic). I guess I'll avoid using switches in Studio entirely.