You are not logged in.

Dear visitor, welcome to krpano.com Forum. If this is your first visit here, please read the Help. It explains in detail how this page works. To use all features of this page, you should consider registering. Please use the registration form, to register here or read more information about the registration process. If you are already registered, please login here.

1

Thursday, June 2nd 2011, 8:09am

How can i check multiple conditions in "IF"?

Hi,

How can i check multiple conditions in single "IF" loop? like we do in javascript.
e.g.
if( a==10 && b==1, trace('called'), trace('nothing') );

is it possible with KRPano?

thanks

--
Pratiks

spacerywirtualne

Intermediate

Posts: 201

Location: Poland, Europe

  • Send private message

2

Thursday, June 2nd 2011, 9:06am

I think it is possible

maybe something like that

Source code

1
2
3
4
5
6
7
if(a==10,
	if(b==1,
	   trace('called')
	,
	   trace('nothing')
	);
);


pietero

3

Thursday, June 2nd 2011, 11:43am

Hi spacerywirtualne,

thanks for your help.
but it is not working with or(||) condition.
like, if( a==10 || b==1, trace('called'), trace('nothing') );

i need to know that such kind of operator(i.e. &&, ||) are supported by KRPano or not?

thanks

--
Pratiks

michel

Professional

Posts: 1,153

Location: ANDORRA

Occupation: TV

  • Send private message

4

Thursday, June 2nd 2011, 12:01pm

Hi Pratiks,

Have a look here ....

SAlut.

5

Thursday, June 2nd 2011, 2:14pm

If you just need a single OR, I usually use this:


<!-- do %3 if %1 is TRUE or %2 is TRUE -->
<action name="ifor">
if(%1,
%3,
if(%2,
%3));

</action>
PanoTag: Facebook tagging for krpano

KRPano development and more: http://www.digisfera.pt/en/development

6

Friday, June 3rd 2011, 7:53am

Hi,

I will try that code.

thanks

--
Pratiks