Jump to content
Sign in to follow this  
joschaap

are nested case switches allowed?

Recommended Posts

im trying to debug some of my misison code, however it seems like the problem lies in my usage of a nested case switch.

is it possible arma's SQF does not allow nested case switches?

example:

switch (foo) do
{
case "bar":
{
switch (that) do
{
case "this":
{
do something
...

Share this post


Link to post
Share on other sites

it was indeed not possible to nest case switches :) reverted to if/else inside the cases :)

thanks!

Share this post


Link to post
Share on other sites
it was indeed not possible to nest case switches :) reverted to if/else inside the cases :)

thanks!

switch 1 do {
case 1: {
	switch 2 do {
		case 1: {
			hint "1";
		};
		case 2:{
			hint "2";
		};
		default {
			hint "3";
		};
	};
};
case 2: {
	hint "4";
};
default {
	hint "5";
};
};

It works for me, the result is 2

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×