Hi!
As expected. After Retry COUNT command has no alias, so it pops up the open dialog box. Cancel on that open dialog box will cause error again and that time it will return correctly. I assume you write this for WWC, so open dialog box will not appear but error will be generated because no output is allowed in the COM server.
BTW, put retry AFTER the this.lFirstTry = .T. (my mistake)
>>Its sad. The code sample you sent works here with such modification...
>>What is your ON ERROR setting? Did you tried to catch it by ON ERROR?
>
>There is no ON ERROR. This is within the error event. This is the code:
>
>
>loProcess=CREATE('RR')
>loProcess.ShowMessage()
>
>DEFINE CLASS RR AS Custom
>
>lFirstTry=.F.
>
>FUNCTION ShowMessage
>loProcess.xx()
>MESSAGEBOX('ShowMessage1')
>ENDFUNC
>
>FUNCTION xx
>COUNT FOR x=z
>*SELECT * FROM CONTACT WHERE IRegion=lnRegion INTO CURSOR TEMP
>MESSAGEBOX('ShowMessage22')
>ENDFUNC
>
>FUNCTION Error
>PARAMETER nError,cMethod,nLine
>MESSAGEBOX('TEST')
>if !empty(alias()) and NOT This.lFirstTry
> select 0
> retry
> this.lFirstTry = .T.
>endif
>This.lFirstTry=.F.
>RETURN TO ShowMessage
>ENDFUNC
>
>ENDDEFINE
>
>
>We assume a table is already open. What this gives, is that I get the TEST message. Then, VFP pops up the open table dialog.
Vlad Grynchyshyn, Project Manager, MCP
vgryn@yahoo.comICQ #10709245
The professional level of programmer could be determined by level of stupidity of his/her bugs
It is not appropriate to say that question is "foolish". There could be only foolish answers. Everybody passed period of time when knows nothing about something.