You are not logged in.

1

Friday, August 8th 2014, 10:52am

why i cant use txtreplace or txtadd function

<scene name='scene_01' title='pano_a' .....
<hotspot name='hs1' linkedscene='scene_01'/>

now i click hotsopt to read the scene name---scene_01, and change the prefix 'scene_' to 'li_', i want got a string li_01;

my code is following:

Source code

1
2
3
txtreplace(li_num,get(linkedscene),'scene_','li_');
trace(li_num);
showlog();


the result should be the 'li_01';
but the true log result is 'li_num', doesn't get the number;

when i use the following:

Source code

1
2
3
4
subtxt(sce_num, get(linkedscene),6,2);	//the sce_num is 01;
txtadd(li_num,'li_',sce_num);
trace(li_num);
showlog()



the li_num should be 'li_01';
but the true log result is 'li_num', still doesn't get the number;



why?

This post has been edited 2 times, last edit by "jigl" (Aug 8th 2014, 11:10am)


2

Friday, August 8th 2014, 12:09pm

Hi,

the second parameter in txtreplace() need to be a variable - that means try it without the get():

Source code

1
txtreplace(li_num, linkedscene,'scene_','li_');


for subtxt() it's the same, but in txtadd() the get() would be needed to add the content:

Source code

1
2
3
subtxt(sce_num, linkedscene,6,2);
txtadd(li_num,'li_',get(sce_num));
trace(li_num);


Best regards,
Klaus

3

Saturday, August 9th 2014, 9:32am

great, got it, thanks a lot