EOS cominbing/joining 2 variables

Post all technical issues and questions here. We'll gladly help you wherever we can.
Post Reply
cksfantasy
Explorer
Explorer
Posts: 8
Joined: Fri Oct 25, 2013 12:55 pm

EOS cominbing/joining 2 variables

Post by cksfantasy »

Hi All,

This one is doing my head in, how do you join 2 variables in EOS?

ie.

var Firstname = "Harry";
var Surname = "Potter";
var Fullname = Firstname + ' ' + surname

I'm sure it should be easy :innocent:

Thanks a mil!
Thamrill
Explorer At Heart
Explorer At Heart
Posts: 265
Joined: Thu Jan 03, 2013 4:55 pm
Gender: Male
Sexual Orientation: Straight
I am a: Submissive

Re: EOS cominbing/joining 2 variables

Post by Thamrill »

Eos scripting engine should be plain JavaScript.

I don't know very much of JavaScript, but I found this: https://www.w3schools.com/jsref/jsref_concat_string.asp
Image

Image

Image
cksfantasy
Explorer
Explorer
Posts: 8
Joined: Fri Oct 25, 2013 12:55 pm

Re: EOS cominbing/joining 2 variables

Post by cksfantasy »

Thamrill wrote: Wed Oct 21, 2020 3:02 pm Eos scripting engine should be plain JavaScript.

I don't know very much of JavaScript, but I found this: https://www.w3schools.com/jsref/jsref_concat_string.asp
Legend! i thought i tried it... but nope! missed this one.

Thank you sir! you have fixed my problem.
fapnip
Explorer At Heart
Explorer At Heart
Posts: 430
Joined: Mon Apr 06, 2020 1:54 pm

Re: EOS cominbing/joining 2 variables

Post by fapnip »

You can also just do:

Code: Select all

string1 = string1 + string2;
or

Code: Select all

var string3 = string1 + string2;
So the code in your first post should have worked, except for the typo of 'surname' vs 'Surname' in your concatenation.
Post Reply

Who is online

Users browsing this forum: No registered users and 9 guests