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.

panoyun

Trainee

  • "panoyun" started this thread

Posts: 57

Location: Somalia

  • Send private message

1

Saturday, February 29th 2020, 3:26am

$variable how to use?

I didn't find anything about this document

$variable


https://krpano.com/docu/actions/#expressions.type

2

Wednesday, March 4th 2020, 6:18pm

Hi,

e.g. when defining a variable like this:

Source code

1
set(text, 123);
or explicitly like this:

Source code

1
def(text, string, 123);
it will be a String internally.

But when doing an mathematical expression, then krpano interprets that String as Number
and the result of such call:

Source code

1
trace(calc(1 + text));
will be

Source code

1
124
( = 1 + 123)

And when using $variable that Interpretation will be avoided, then the variable will be used as String,
so this call:

Source code

1
trace(calc(1 + $text));
will be result in

Source code

1
1123
( = 1 + "123")

Best regards,
Klaus

panoyun

Trainee

  • "panoyun" started this thread

Posts: 57

Location: Somalia

  • Send private message

3

Thursday, March 5th 2020, 3:17pm

thank you
Klaus
Thank you very much for your detailed answer
Love you
*thumbsup*