Sie sind nicht angemeldet.

1

Donnerstag, 2. Juni 2011, 08:09

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

Beiträge: 1 117

Wohnort: Poland, Europe

Beruf: krpano developer : virtual tours : the cms4vr owner

  • Nachricht senden

2

Donnerstag, 2. Juni 2011, 09:06

I think it is possible

maybe something like that

Quellcode

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


pietero
Your own professional, online cloud tool for creating virtual tours - www.cms4vr.com

facebook page :: youtube :: wiki.cms4vr.com

cms4vr team *thumbsup*

3

Donnerstag, 2. Juni 2011, 11:43

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

4

Donnerstag, 2. Juni 2011, 12:01

Hi Pratiks,

Have a look here ....

SAlut.

5

Donnerstag, 2. Juni 2011, 14:14

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

Freitag, 3. Juni 2011, 07:53

Hi,

I will try that code.

thanks

--
Pratiks

Ähnliche Themen