Create A Simple Counter In A Text Component


Recommended Posts

Posted

I have a button, and a text component. I would like the text component to display "Total Time: 00:00" initially, and once the Start button is pressed, the time starts counting. I have a Channel called AccumTime which is setup as a test channel and counts incrementing by 1 sec.

All I need to know is the syntax for Scripting the Start Button to Start the Count

post-8954-0-31821600-1364926017_thumb.jp

post-8954-0-17150700-1364926028_thumb.jp

post-8954-0-92850300-1364926034_thumb.jp

Posted

No, actually I would like the Button to start a quick sequence that tells "component.varTotalTime.strCaption" to increment by 1 (counting indefinitely)

When 60 seconds is made Total Time 01:00 is displayed, etc...

By the way, Thank You for your assistance.

Posted

I figured how to get SYSTIME() to display in the variable component

(Do I really have to programmatically tell DF to specify what I want displayed... Say 00:00, at first and then 00:01, and 00:02...etc... dependant on the current time.)

That's really the only way I can see it working, unless there's another function out there

Posted

No, that is backwards. If you want to display time since a button was pressed do this:

1) in the button's Action, select Quick Sequence, and put:

global startTime = systime()

2) create a variable value control like I first said. For the expression put:

FormatTime(systime() - startTime)

That's it. You don't need, or want a sequence.

Posted

I don't really need the time since the button was pressed, I need the increment of pressing the button, Press Start Button and the variable text component starts counting relative to nothing more than the Start Button being pressed... irregardless of how much time has elapsed since the button was pressed

Posted

You mean you want it to increment every time the Start button is pressed? Basically giving you the # of times the button was pressed? I'm really not clear what you are trying to count.

Posted

Maybe he is looking for something like this?

(lmk if you can not open the .ctl document, I will "re-compile" on my other machine!)

HTH

Time.ctl

Archived

This topic is now archived and is closed to further replies.