Thanks, this revised version does change colors:

--cls
set var fColor text = null
getproperty aaSafe|rbase_Form color 'fColor'

switch (.fColor)
case 'red'
property aaSafe|rbase_Form color 'blue'
break

case 'blue'
property aaSafe|rbase_Form color 'red'
break

default
pause 2 using 'No color change.'
break

endsw
RETURN

I guess Rbase_Form refers to the selected window and not the calling form.


________________________________
From: [email protected] [mailto:[EMAIL PROTECTED] On Behalf Of Lawrence Lustig
Posted At: Wednesday, October 22, 2008 1:28 PM
Posted To: RB7-L
Conversation: [RBASE-L] - Re: Hanging up
Subject: [RBASE-L] - Re: Hanging up

<<
When I click the button if I leave out the "CLS" in the timer it looks the 
timer doesn't fire.  With the "CLS" it clears the pause 2 message but it 
doesn't fire rest of the timer code and I can't click on the form to close.  I 
need to use task manager to log out.
>>

I think R:Base is probably getting confused over what RBASE_FORM means in this 
context because the PAUSE 2 is causing the main form to lose focus.

First, off, determining whether the TIMER _really_ isn't running or (as I 
suspect) it _is_ running but not returning one of the two colors you expect.  
Then you can figure out how to handle the error.  If it's a focus problem, 
there's I think syntax to explicitly name the form you want to get the property 
from (GETPROPERTY FormName|RBASE_FORM COLOR 'fColor').

Two programming notes:

1. You should declare and type that fColor variable immediately before 
GETPROPERTY.

2. On SWITCH statements, it's always a good idea to include a DEFAULT case.  
Put an error message in there to say that an expected color was encountered.

--
Larry



Reply via email to