|
adamwalker Apprentice
Joined: 12 Mar 2005 Posts: 195
|
Posted: Wed May 16, 2007 8:36 am
use of %eval in a button |
put %eval((@timerstart - %secs)/1000) in a button... and i get a result like -34539
put it in a alias and run the alias and i get the correct result which is more like 300. any ideas why? |
|
|
|
Arminas Wizard
Joined: 11 Jul 2002 Posts: 1265 Location: USA
|
Posted: Wed May 16, 2007 3:02 pm |
Buttons don't like to expand more than one level. So you can expand a variable reference but not a function.
var=%eval((@timerstart - %secs)/1000)
Then place @var in the button label.
You could try using an expression trigger to set the variable or an alarm that goes off once a second to set it. |
|
_________________ Arminas, The Invisible horseman
Windows 7 Pro 32 bit
AMD 64 X2 2.51 Dual Core, 2 GB of Ram |
|
|
|
adamwalker Apprentice
Joined: 12 Mar 2005 Posts: 195
|
Posted: Thu May 17, 2007 5:46 pm |
hmmm. that does work..
problem is tho that i need to update @var every few seconds to get an accurate number in the button. any idea how i could do that? other then something horrific like a every second alarm |
|
|
|
Tech GURU
Joined: 18 Oct 2000 Posts: 2733 Location: Atlanta, USA
|
Posted: Thu May 17, 2007 5:58 pm |
How are you getting the values that feed @var?
|
|
_________________ Asati di tempari! |
|
|
|
Arminas Wizard
Joined: 11 Jul 2002 Posts: 1265 Location: USA
|
Posted: Fri May 18, 2007 12:58 pm |
The thing is just how often do you want it to update? If you don't need it to be extremely often you could place it in the prompt, AND make an alarm that fires every 30 seconds or so.
|
|
_________________ Arminas, The Invisible horseman
Windows 7 Pro 32 bit
AMD 64 X2 2.51 Dual Core, 2 GB of Ram |
|
|
|
|
|