Jump to content
trevor

Combine Variable Strings

Recommended Posts

I'm trying to show some information in a label that combines several variables...How do I combine text values?

Share this post


Link to post
Share on other sites

At the time, you cannot unite two text variables to one new string. Use instead two (or more) labels next to each other to show the information.

Zur Zeit kannst Du nicht zwei Textvariablen zu einer neuen Zeichenfolge vereinigen. Benutze stattdessen zwei (oder mehr) nebeneinander angeordnete Beschriftungen um die Informationen zu zeigen.

Henry

 

Share this post


Link to post
Share on other sites
17 hours ago, Henry said:

At the time, you cannot unite two text variables to one new string. Use instead two (or more) labels next to each other to show the information.

Zur Zeit kannst Du nicht zwei Textvariablen zu einer neuen Zeichenfolge vereinigen. Benutze stattdessen zwei (oder mehr) nebeneinander angeordnete Beschriftungen um die Informationen zu zeigen.

Henry

 

I hope you are going to add this feature, the OTHER reason I'd like to do this is to combine variables to POINT at an object.

e.g. "Track_" & Variable

Share this post


Link to post
Share on other sites

Specifically at the moment.. I want to lookup a NEXT action for a train when it enters a track section. Obviously I need to use the track section ID but I would also need to combine the entry direction into the track AND the direction of the locomotive itself (i.e is it reversing)

Share this post


Link to post
Share on other sites
14 hours ago, Curt84328 said:

this might work,  since a label only tells the user something and does nothing else  you use more than one label.

name and speed.mbp

Not really what I am looking for though Curt, I want to create a single variable name from a fixed set of conditions to reference some other variable or object.

e.g. On a track section I know the Train_Name (Say "Coal_Train") , I can lookup the train speed so I know if it is going forwards or backwards, and I can tell by the track events if it is moving say East or West, So I want to lookup a variable list with the name "Coal_Train_Forwards_East", "Coal_Train_Forwards_West" etc.

Ability to create simple FUNCTIONS would be great too... something like this.

Functoin_Dialog_1.jpg

Functoin_Dialog_2.jpg

Edited by trevor

Share this post


Link to post
Share on other sites

Hello Trevor,

may be, that "object variables" can help you:

In contrast to normal variables, which are identified by an arbitrary name, object variables are assigned to a specific object (e.g. a locomotive) and then referred by objectName.variableName. See the example below:

Objekt-Variable definieren.png

Defining an object variable "by hand", mark he object (in the example above the locomotive) and select the object variable editor by a click to the icon surrounded with a red circle. The definition window for variables to be assigned to the marked object will be opened. Here, you can specify the variables and assign values.

You can find already defined variables in the event control window after you have selected the link "Active timers and variables" at the right bottom corner.

Objekt-Variable referenzieren.png

You can manipulate the object variables also here.

Using the event control environment for manipulating and evaluating object variables, handle them analogously to normal variables with the difference, the object variables are referred by the syntax already shown above: "objectname.variablename".

Many greetings
BahnLand

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×