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

Wednesday, May 22nd 2013, 8:27pm

Assignment operator

Hello guys,
I'm pretty new to KRPano so forgive me if my question seems trivial, I'm trying to perform simple assignment operation between two variables Var1 and Var2

Source code

1
	set(var1, 1);	set(var2, var1);	trace('var1 = ' , var1, ' var2 = ' ,var2);



I was expecting to have the result as ( var1 = 1 , var2 = 1 ) however the actual result was ( var1 = 1, var2 = var1 )

Any advise?

Umalo

Professional

Posts: 1,047

Location: Osijek, Croatia, EU

  • Send private message

2

Wednesday, May 22nd 2013, 9:22pm

try with:

Source code

1
set(var1, 1);	set(var2, get(var1));	trace('var1 = ' , var1, ' var2 = ' ,var2);

or

Source code

1
set(var1, 1);	copy(var2, var1);	trace('var1 = ' , var1, ' var2 = ' ,var2);


Also see:
http://krpano.com/docu/actions/#get

http://krpano.com/docu/actions/#copy

3

Wednesday, May 22nd 2013, 9:35pm

Worked fine, thank you :)