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

Friday, July 26th 2019, 5:49am

Default protocol as parameter transfer problem

<action name="test">
trace(%1);
</action>
test("//krpano.com");
result null

2

Friday, July 26th 2019, 11:09am

right.. something is odd here :

in test2() "//krpano.com" gets logged
in test1() it doesnt, and logging "after" is not executed at all ....

strange

Source code

1
2
3
4
5
6
7
8
9
10
<action name="test1">
trace('before');
debug(%1);
trace('after');
</action>

<action name="test2" autorun="onstart">
debug("//krpano.com");
test1("//krpano.com");
</action>

3

Saturday, July 27th 2019, 12:01am

Hi,

note - the %NN is text-placeholder!

so the:

Source code

1
trace(%1);

becomes:

Source code

1
trace(//krpano.com);

and '//' is a comment, so the final code will be just:

Source code

1
trace(

That's invalid code and breaks the following actions, but the trace itself gets called.

If you want to avoid that problem, either quote the parameter:

Source code

1
trace('%1');

or better use a localscope action and argument variables:

Source code

1
2
3
<action name="test" scope="local" args="msg">
trace(get(msg));
</action>


Best regards,
Klaus

4

Saturday, July 27th 2019, 12:14am

:) seems i lost track of xml coding ;)