General area when it fits no where else

Moderator: Mmiscool

User avatar
By JMS
#42953 I need to combine more than 2 variables:
Code: Select alllet x = "alpha"
let y = "bravo"
let z = "charlie"

let n = x & y --> works as expected n=alphabravo
let n = x & y & z --> does not work  n = alphabravo not n=alphabravocharlie as expected
let n= x & y & "Some string" -> does not work either


How do you properly concatenate multiple variables and /or strings?

Thanks!
User avatar
By viscomjim
#42956 let x = "alpha"
let y = "bravo"
let z = "charlie"

n = x & y '<<< n will now be alphabravo
n = n & z '<<< n will now be alphabravocharlie



you have to keep adding to the string after the first one. I don't think you can do 3 at one time. I might be wrong with the new updates...
User avatar
By JMS
#43088 Thanks, I believe you are correct. It looks like I will have to take multi-step approach. Ultimately I need to use the wget function to send some information.

wget(example.com/page.php?option1=alpha&option2=bravo2&option3=charlie)

So to build that string from my variables I would need to:

Code: Select all[urlVars]
let base = "example.com/page.php?option1="
let opt2 = "&option2="
let opt3 = "&option3="
let x = "alpha"
let y = "bravo"
let z = "charlie"

[buildUrl]
let base = base & x
let base = base & opt2
let base = base & y
let base = base & opt3
let base = base & z
wget(base)


As opposed to something like this:

Code: Select allwget("example.com/page.php?option1="&x&"&option2="&y&"&option3="&z)