Switch to desktop version  
Concatenating Two Variables - Printable Version

+- Ewon Technical Forum (https://techforum.ewon.biz)
+-- Forum: Development (https://techforum.ewon.biz/forum-50.html)
+--- Forum: BASIC Script (https://techforum.ewon.biz/forum-52.html)
+--- Thread: Concatenating Two Variables (/thread-1138.html)



Concatenating Two Variables - ibeason - 07-01-2020

Is there an easy way to concatenate two tags and store in the ewon memory registers?

Thanks!


RE: Concatenating Two Variables - simon - 08-01-2020

Hi,

Sure it is possible.
I guess you are talking about String Tags ?
What you can do in the init section :
ONCHANGE "Tag1", "Tag3@ = Tag1@ + Tag2@"
ONCHANGE "Tag2", "Tag3@ = Tag1@ + Tag2@"

If Tag1 or Tag2 are numerical Tags, then use the function TSR$ to cast the value into a string (Tag3@ = STR$ Tag1@ + STR$ Tag2@ -->Tag3@ is string tag)

Simon


RE: Concatenating Two Variables - Santhosh.kumar - 25-03-2022

This thread has been marked as solved. If you have a similar issue, it would be better to post your own thread rather than bump this one, to help keep everybody's different issues separate.

(08-01-2020, 02:37 PM)simon Wrote: Hi,

Sure it is possible.
I guess you are talking about String Tags ?
What you can do in the init section :
ONCHANGE "Tag1", "Tag3@ = Tag1@ + Tag2@"
ONCHANGE "Tag2", "Tag3@ = Tag1@ + Tag2@"

If Tag1 or Tag2 are numerical Tags, then use the function TSR$ to cast the value into a string (Tag3@ = STR$ Tag1@ + STR$ Tag2@  -->Tag3@ is  string tag)

Simon
Hi simon
I have 5 string tags.

i have to concatenation the thease 5 tag values and it has to save in the string 6 , How to do this ?

Ex string tag 1 value( 3)
      string tag 2 value(  7 )
      string tag 3 value(  * )
      string tag 4 value(  *)
    string tag 5 value(  1,2,3,4,5 )

Now these all tags should be combine and saved to

Result string tag 6 = (3 7 * * 1,2,3,4,5)

how to do this ?


RE: Concatenating Two Variables - simon - 25-03-2022

Santosh,

You have to do

ONDATE 1, STR$ sMinute@ +" "+ STR$ sHour@ + " " + STR$ sDate@ + " " + STR$ smonth@ + " " + STR$ sweek@, "Tag1@ = 1 + Tag2@ = 1 + Tag3 = 1"