You're reading ...
Traincontroller

Traincontroller 48: Use a Numerical Variable as a Counter

Variables are one the great additions to TC 9. A variable is a named memory location where we can store information, like a text or a number. We can access and change the contents of a variable via any item on our switchboard that has an Operations tab. We can use variables to change the flow of Operations and we can add them to Text Fields to display their contents.

This video is about how a numerical variable can be used to create a counter. Three things are needed to get this working:
1: Create a variable of the type numerical.
2: Increment / decrement the value of the variable in the Operations Tab of an item on the switchboard.
3: Display the contents of the variable in a text field.

 

About RudyB

Hobbyist

Discussion

5 thoughts on “Traincontroller 48: Use a Numerical Variable as a Counter

  1. Hello Rudy, all your tutorial about Traincontroller are very helpful and I’m following all of your posts. Juste a request about the Numerical counter. How could I do that the counter is changing automatically when a new schedule has started? Until know, I can change the values only with the two buttons as you’re showing in your tutorial.
    Beat

    Like

    Posted by Greub Beat | January 15, 2018, 20:50
  2. My best wishes for 2018.
    The start of the new year with this excellent tutorial of TC9 could not be better.
    I’m looking forward for the next one.
    Jos

    Like

    Posted by josgovaarts2013 | January 2, 2018, 11:27

Trackbacks/Pingbacks

  1. Pingback: Traincontroller 49: Use HTML to Simulate an LCD Display | rudysmodelrailway - January 16, 2018

Leave a comment

Archive of all posts