In my current project I have two cards, the main page/card and a second 'settings' page.
My goal is to have the program automatically exit the 'settings' page if there is no user activity/changes made within 30 seconds. So far this works correctly. However (isn't there always a HOWEVER). Once I am back on the main page, the timer seems to still be running, causing issues and taking control of the editor (meaning I can't regain editing of my script till I force quit - On a MAC!)..
See script below.
I have attempted to use the cancel command, but there is no good examples of how do cancel a "Send" command. Or am I misunderstanding how this works?
After 20 seconds of inactivity the counter background turns red/text white. If the user selects/changes anything it resets the the timer. Once it reaches 30 seconds it saves the data and exits the card (hopefully returning to card 1).
if I use:
go to Card "AlarmMonitor" instead of closeCard in cardtime (when 30 seconds is reached).. AND remove 'send "cardtime" to me in 0 seonds.. It operates correctly but I am locked out of the editor.. Bug?
(Still awaiting my "Training Video" from a December order, something tells me I'm never getting them! Part of the MegaDeal!)
Trying to get the logic of how runrev works would have been a little easier with the videos! Perhaps even answer a few of my basic questions a LOT faster!
~David
------------------------------------------------------------------------------------
on opencard
set the radioBehavior of last group to true
set the backgroundColor of fld "myCardCountdown" on Card "AlarmSettings" to "green"
set the foregroundColor of fld "myCardCountdown" on Card "AlarmSettings" to "black"
put the seconds into fld "myCardStartTime" on Card "AlarmStatus"
put the seconds into fld "myCardCurrentTime" on Card "AlarmStatus"
cardtimer
end opencard
on closeCard
send "cardtimer" to me in 0 second
SaveAlarmMonitorData
end closeCard
on cardtimer
put the seconds into fld "myCardCurrentTime" on Card "AlarmStatus"
put fld "myCardStartTime" on Card "AlarmStatus" into myCardStartTime
put fld "myCardCurrentTime" on Card "AlarmStatus" into myCardCurrentTime
put myCardCurrentTime - myCardStartTime into myTimeOnCard
put myTimeOnCard into fld "myCardCountdown" on Card "AlarmSettings"
if myTimeOnCard >= 20 then
set the backgroundColor of fld "myCardCountdown" on Card "AlarmSettings" to "Red"
set the foregroundColor of fld "myCardCountdown" on Card "AlarmSettings" to "white"
end if
if myTimeOnCard >= 30 then
put "0" into fld "myCardStartTime" on Card "AlarmStatus"
put "0" into fld "myCardCurrentTime" on Card "AlarmStatus"
put "0" into fld "myCardCountdown" on Card "AlarmSettings"
closeCard
end if
send "cardtimer" to me in 1 second
end cardtimer
Canel Send "cardtimer"
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
-
- Posts: 30
- Joined: Sun Feb 28, 2010 9:52 pm
- Contact:
-
- Posts: 30
- Joined: Sun Feb 28, 2010 9:52 pm
- Contact:
Re: Canel Send "cardtimer"
Think I figured it out! (only takes HOURS) <sigh>
send "cardtimer" to me in 0 second
should be (FOR EXAMPLE):
send "timerInterval" to this card in 1 second
Meaning "on this card" rather than to ME..
~David
send "cardtimer" to me in 0 second
should be (FOR EXAMPLE):
send "timerInterval" to this card in 1 second
Meaning "on this card" rather than to ME..
~David