>>>>I'm Using VFP7.0 SP1
>>>>Is there any function that will tell me if a READ EVENTS is in effect?
>>>
>>>AFAIK, there's no such function in VFP. Why do you need to know that?
>>>You can add a property to store that info.
_Screen.Addproperty("lReadEvents", .F.)
>>>_Screen.lReadEvents =.T.
>>>READ EVENTS
>>>_Screen.lReadEvents =.F.
>>
>>
>>>Why do you need to know that?
>>I have a client who frequently does his own "programming" in VFP. He usually has a "Read Events" in effect so his employees don't have a command window, but he works on a separate terminal without a "Read Events". He never seems to do things the same way twice, so I've been unable to set up any kind of flag that lets me know that it's him that is the user.
>>
>>In my "On Error" procedure, I have "RETURN TO MASTER". I'm trying find a way of determining whether there is a "Read Events" in effect, so I can just "CANCEL" instead. I've thought about checking "WVISIBLE('Command')", but sometimes he manages to get a command window showing even though the "READ EVENTS" is in effect.
>>
>>Any ideas?
>
>Maybe you can check program calling stack?
That's what I'm doing now, but it means checking for a specific Program-Name, and I don't like that. If he changes which program has the "Read Events" in it, the Error-Handler quits working right.
I'm going to change it so that it checks Prog(1) to see if it's an Object or not. I think I can safely assume that prog(1) WILL NOT be an object if there is a "Read Events" in effectl. If prog(1) is an object then the Error-Handler will "CANCEL", if not "RETURN TO MASTER".
Can you think of a way that prog(1) WILL BE an object with "Read Events" in it? The only way I can think of is :
MAIN.PRG
Public oApp
oApp = CreateObject('cusApp')
_Shell = 'oApp.Read_Events()'
Define cusApp as Custom
Procedure Read_Events
Read Events
End Proc
End Define
and I can't imagine anyone setting up an app like that.
Thanks.
Bill Morris