Welcome Guest ( Login | Register )



All times are UTC - 7 hours [ DST ]



Post new topic Reply to topic  [ 2 posts ] 
Author Message
 Post subject: Merge tags
PostPosted: Wed Oct 09, 2019 7:14 am 

Joined: Tue May 28, 2019 3:21 am
Posts: 6

Offline
I just wondering if you can merge tags using script.
As example you make a intertal tags "naming" and "type" as string
and "number" as integer.

Can you do something like "naming" = "type" + "Number"


 Profile  
 
 Post subject: Re: Merge tags
PostPosted: Thu Oct 10, 2019 7:33 am 

Joined: Mon Jun 11, 2012 2:10 pm
Posts: 130

Offline
Hi BeeJee,

What do you mean by merge?

Do you mean if "type" has the string value "world" and number has the integer value '9' that you want naming to have the string value "world9"?

If yes, you can use string.Format:

globals.Tags.naming.Value = string.Format("{0}{1}", globals.Tags.type.Value, globals.Tags.number.Value);

another method is to use concatenation:

globals.Tags.naming.Value = globals.Tags.type.Value + globals.Tags.number.Value.ToString();

_________________
Adam M.
Controls Engineer
FlexEnergy


 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

All times are UTC - 7 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to: