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 14th 2017, 5:03am

how to extract parameters from Bgshadow = "40 32 18 36 0x00FFFA 0.5" Bgborder = "22.74.22.67 0xC57200 0.78"

Hello
Tell me how to extract parameters from
Bgshadow = "40 32 18 36 0x00FFFA 0.5"
Bgroundedge = "99 99 00 00"
Bgborder = "22.74.22.67 0xC57200 0.78"

(A = 40, b = 32 ... e = 0x00FFFA ...)?

Subtxt do not work, the length of the text can be different.

3

Friday, July 14th 2017, 7:19pm

thanks for the answer! But how?

copy(Border_1,layer[layer_San].bgborder);

Border_1 = 2,10,120,5 0xFFFFFF 0.8 There are no separators
?
a=2, b=10, c=120, d=5, e=0xFFFFFF, f=0.8 ?



bgborder="34,07,06,14 0x8C879D 1

jordi

Intermediate

Posts: 464

Location: Barcelona

Occupation: creating ideas & coding them

  • Send private message

4

Friday, July 14th 2017, 11:46pm

blank space is a separator itself so you can use it like this :

Source code

1
2
3
set(myVar, 40 32 18 36 0x00FFFA 0.5);
txtsplit(get(myVar), ' ', a, b, c, d, e, f);
debug('a=',a,' b=',b,' c=',c, ' d=',d,' e=',e,' f=',f,);


or following your code exactly you would do that :

Source code

1
2
txtsplit(get(layer[layer_San].bgborder), ' ', top_width, right_width, bottom_width, left_width, color, alpha);
debug('top_width=',top_width,' right_width=',right_width,' bottom_width=',bottom_width, ' left_width=',left_width,' color=',color,' alpha=',alpha,);;
everpano.com step beyond 360

5

Saturday, July 15th 2017, 8:04am

*thumbsup* Thank you!

top_width - Lower underscores do not work.
topwidth - it worked!

30 76 81 27 0xC8FF00 0.5 - Yes, it shares *thumbsup* !
15,20,11,05 0xD200E0 0.5 - *confused* no, the comma is not a delimiter and outputs so
a=15,20,11,05 b=0xD200E0 c=0.5



Found!
15,20,11,05 0xD200E0 0.5 -->

txtreplace(dstvar,layer[color].bgborder,',',' '); - Substitution by a comma for a space -->

15 20 11 05 0xD200E0 0.5

This post has been edited 1 times, last edit by "San7" (Jul 15th 2017, 10:37am)


jordi

Intermediate

Posts: 464

Location: Barcelona

Occupation: creating ideas & coding them

  • Send private message

6

Saturday, July 15th 2017, 11:21am

Top_width must work in the same exact way as any other name not beginig with a number...
So there you must have another syntax error.
everpano.com step beyond 360

7

Saturday, July 15th 2017, 4:54pm

Top_width должен работать точно так же, как любое другое имя, не начинающее с номера ...
Таким образом, вы должны иметь другую синтаксическую ошибку.
*thumbsup* Yes, syntax error, everything works! Thank you!


Similar threads