Hi,
I'm tying to get a button to change it's name to No User and another button to change it's name to Open with a green background when the mouse is not moved after 5 minutes. The compiler keeps telling me (compilation error at line 11 (Commands: missing ',') near "into", char 25) see below. Any suggestions?
on moveStopped
put the seconds into lStart
updateMouseTime
end moveStopped
on updateMouseTime
if the name of btn id "3895" is "No User" then
exit updateMouseTime
put the seconds – lStart into tElapsedTime -- warning says - compilation error at line 11 (Commands: missing ',') near "into", char 25
if tElapsedTime > 300 seconds then
set the name of btn id "3895" to "No User"
set the backgroundColor of btn id "3898" to "green" --backgroundColor
set the name of btn id "3898" to "Open"
end if
end if
end updateMouseTime
mouse no movement timer
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller
Re: mouse no movement timer
Hi,
did you declare "lStart" as LOCAL or GLOBAL?
Best
Klaus
did you declare "lStart" as LOCAL or GLOBAL?
Best
Klaus
Re: mouse no movement timer
Klaus, I forgot that! But I put in a global since you mentioned it and it did the same thing.
global lStart
on moveStopped
put the seconds into lStart
updateMouseTime
end moveStopped
on updateMouseTime
if the name of btn id "3895" is "No User" then
exit updateMouseTime
put the seconds – lStart into tElapsedTime -- warning says - compilation error at line 11 (Commands: missing ',') near "into", char 25
if tElapsedTime > 300 seconds then
set the name of btn id "3895" to "No User"
set the backgroundColor of btn id "3898" to "green" --backgroundColor
set the name of btn id "3898" to "Open"
end if
end if
end updateMouseTime
global lStart
on moveStopped
put the seconds into lStart
updateMouseTime
end moveStopped
on updateMouseTime
if the name of btn id "3895" is "No User" then
exit updateMouseTime
put the seconds – lStart into tElapsedTime -- warning says - compilation error at line 11 (Commands: missing ',') near "into", char 25
if tElapsedTime > 300 seconds then
set the name of btn id "3895" to "No User"
set the backgroundColor of btn id "3898" to "green" --backgroundColor
set the name of btn id "3898" to "Open"
end if
end if
end updateMouseTime
Re: mouse no movement timer
Hi.
It's always the little things. And the big things.
First, A danger in LC is that because it is so english-like, beginners fall into language traps. The machine will trip even if you talk to it with good grammar, but with bad syntax. Lose "seconds" in the line with the "if".
Second, something is wrong with the "-" in the line "put..."
This was a puzzler until I later checked out what you wrote. It is not a dash (minus operator), it is charToNum(208). Just lose that section, and rewrite with a normal "-".
Next, play with passing the seconds as a parameter to the handler. Then you don't ever need a global. Write back if that is not clear. Keep at it.
Craig Newman
It's always the little things. And the big things.
First, A danger in LC is that because it is so english-like, beginners fall into language traps. The machine will trip even if you talk to it with good grammar, but with bad syntax. Lose "seconds" in the line with the "if".
Second, something is wrong with the "-" in the line "put..."
This was a puzzler until I later checked out what you wrote. It is not a dash (minus operator), it is charToNum(208). Just lose that section, and rewrite with a normal "-".
Next, play with passing the seconds as a parameter to the handler. Then you don't ever need a global. Write back if that is not clear. Keep at it.
Craig Newman