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.

Tuur

Sage

  • "Tuur" started this thread

Posts: 3,096

Location: Netherlands

Occupation: Krpano custom coding / Virtual Tours / Photography / Musician / Recording engineer

  • Send private message

1

Friday, May 17th 2019, 10:51am

get(calc());

Hi,

i think it would be great to have a syntax option to use calc in get actions like:

maybe something like this?

Source code

1
copy(bla, get(calc('bla' + blaaa_ + i)));

so we can do this in one line:

Source code

1
2
        set(stickietitle, calc:'global.data[stickie_close].content');
        copy(stickietitle,get(stickietitle));


i might be wrong or confused, like normal fridays ;-), but i think this is not possible yet in one line, is it?


Tuur *thumbsup*
http://www.virtualtuur.com
Skype:studiotuur

2

Friday, May 17th 2019, 11:20am

hi tuur...
i wanted to answer.. but then i got confused of what you want to do .)

but for a quick one... it might be that calc needs a semicolon
copy(bla, get(calc('bla' + blaaa_ + i);));

index :)

Tuur

Sage

  • "Tuur" started this thread

Posts: 3,096

Location: Netherlands

Occupation: Krpano custom coding / Virtual Tours / Photography / Musician / Recording engineer

  • Send private message

3

Friday, May 17th 2019, 2:34pm

get(calc)); -- > solved

Ahh yes that works!

like

Source code

1
copy(layer[result].html, get(calc('cars.type' + %1)));


the extra semicolon is also not needed...
Great!
Saves some lines!
Little example here: https://www.virtualtuur.com/krpano/get/1/

Source code

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
    <action name="DoResult_1">
        set(res, calc:'cars.type' + %1);
        copy(res,get(res));
        set(layer[result].html, calc:res);
    </action>
    
    <action name="DoResult_2">
        set(res, calc:'cars.type' + %1);
        calc(layer[result].html, get(res));
    </action>

    <action name="DoResult_3">
        copy(layer[result].html, get(calc('cars.type' + %1)));
    </action>

    <action name="DoResult_4">
        copy(bla, get(calc('cars.type' + %1)));
        set(layer[result].html, calc:'i love ' + bla);
    </action>


I was looking for DoResult_3 and DoResult_4.
Would be even more great to have DoResult_4 possible in one line.



Tuur *thumbsup*
http://www.virtualtuur.com
Skype:studiotuur

4

Friday, May 17th 2019, 3:43pm

hm, i never use calc: in action code, only calc()

does that work ?
set(res, calc:'cars.type' + %1);

i thought calc: is for attributes only
<element attr="calc:1+2" />

Tuur

Sage

  • "Tuur" started this thread

Posts: 3,096

Location: Netherlands

Occupation: Krpano custom coding / Virtual Tours / Photography / Musician / Recording engineer

  • Send private message

5

Friday, May 17th 2019, 4:10pm

Hi index,

Yes that works. I use it a lot.

Source code

1
set(res, calc:'cars.type' + %1);


Tuur *thumbsup*
http://www.virtualtuur.com
Skype:studiotuur