Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: on Tue 10/08/2004 20:24:41

Title: switch statements
Post by: on Tue 10/08/2004 20:24:41
Does Ags support switch statements ?  If so how are they used in ags? are they just like c?
Title: Re: switch statements
Post by: Gilbert on Wed 11/08/2004 03:30:52
no. you have to use nested if's.
Title: Re: switch statements
Post by: on Wed 11/08/2004 07:14:05
Nested ifs are messy and ineffecient compared to switch statements. Are there any plans to include it in future versions?  mabye I could write a function that will help.
Title: Re: switch statements
Post by: Gilbert on Wed 11/08/2004 07:25:41
It's on the to-do list, but I think it's not of high priority.
Title: Re: switch statements
Post by: Radiant on Wed 11/08/2004 10:11:03
If you must, you can do something with an array of structs, and search as per a binary tree. Scripts aren't particularly efficient, but then 95% of AGS's processor time is spent updating the screen, so it doesn't bother people even on a 300 MHz machine.
Title: Re: switch statements
Post by: on Wed 11/08/2004 18:26:09
Yes I suppose I could do that, but I was just looking for a ready made easy way to do it.
Title: Re: switch statements
Post by: TerranRich on Thu 12/08/2004 06:12:52
Not in AGS. It isn't important to CJ (Pumaman) because there's a workaround that we all use (if's).