Cancel Button Does not work--A known bug?

I have no idea if it is a known bug. The important fact for me is that it is a bug.

It occurs in _VFP.StartMode = 4 as well as in interactive session (_VFP.StartMode = 0). It caused me to lose numerous error records before I realized what was going on. In exe environment when one error follows another there is no way to quit because the Cancel button does not do what it is supposed to be doing. You crush the system and no records are saved of course.

Anyway, this is a stamp of one of the session errors:

An error has occured
"feature is not available"
(1001)
ADDPROPTOFORM 2998 ....
Record details in error log files
Two options (buttons) are presented: YES and NO

After you press "YES" another message appears:
Continue Executing Program
Choose:
OK to continue the program
CANCEL - to exit program completely.
There are two buttons: OK and Cancel.

The problem is that "CANCEL" does not work at all. Pressing Cancel continues the program as if you pressed "YES"

If you choose "NO" in the first message it still gives you endless run around.

Regards.




Answer this question

Cancel Button Does not work--A known bug?

  • ZmrAbdulla

    No, you do not need to reinstall VFP for error handling. There is no built in error handling ion VFP. Just what you add in your programs using the error handling commands at your disposal. If you don't use them to trap and handle errors, they of course get trapped by VFP with the usual ugly dialog that you are not supposed to show your users.

    You can check more on error handling in the help file. Look for:

    Try..Catch
    On Error
    On Shutdown

    and there is a lot of good info in our Wiki:
    http://fox.wikis.com/wc.dll Wiki~ErrorHandling
    http://fox.wikis.com/wc.dll Wiki~ErrorHandling101

    Also Doug Hennig [MVP] has a great error handling article and routine:
    http://download.stonefield.com/pub/errorh.zip

    HTH

     


  • oaix

    Thank you very much Ed. I appreciate it. The problem is, and I am very sorry for that, I neither have time, nor inclination nor the frame of mind (personality) to go into it. I get easily bored with this stuff. I am not in analytical mode around here. I have mentioned this before. I do respect other individuals who can do it, I cannot. Even when I've done it in the past it gave me no additional leverage.

    I have analyzed this thing differently. I think there is a semantic problem in here. This is the message I get on the message box:

    CANCEL - to exit program completely.

    I have noticed while reading some help pages that they at times use "program" for a block of code, method, function, etc. It is not what I mean by a "program." For me the program is an application. Exit program completely should mean that all error messages be saved, all environment cleared as to the state it was before I began my form or whatever and I should get my browser back.

    After much reflection I have come to believe that this is in fact a bug. I do not revel in things like that. I won't bother filing a report because I am short of time, and I do not care. On top of that peope dispute the fact it is a bug. I think you would have thought differently if you had one error message after another coming onto you and you have no option but to crush your system. Thus all errorlog messages are lost and you do not know where to begin next time.

    Cetin said that it was a bug in my code. OF COURSE IT WAS. That is the whole point. But that Cancel button does not make any sense. It is almost like it could be removed and nobody notice.



  • bohan

    Thanks a lot.

    However, why do I get them on two different machines I will look into it seriously. Even when I posted it it crossed my mind that other people (even MS developers) must have faced this problem. But how can my application be responsible for Cancel Button not terminating the program execution and quitting It is a puzzle. I am just talking to myself here. It is almost like saying that Alt+Ctrl+Del will not bring the Task manager up the desktop Of course, you must be right, you know what you are saying but where is the bug

    FoxPro works in mysterious ways, foxy ways, but it is a great piece of software.



  • ArtySaravana

    Alex,

    When I said "it was a bug in your code" I did not mean the application bug that causes your error handler to kick in. I meant the bug in your error handler code itself. IOW if your handler code is saying "Cancel-exit program completely" and doesn't do what it is supposed to do for you then it is not VFP's fault.


  • Isty Ahmad

    I now understand what you meant. Thanks. I may think about it. Where can I get a better error handler if mine is corrupted Shall I reinstall FoxPro for that

    Anyway, YOU HAVE SOLVED MY OTHER PROBLEM. I will tell you what I did in the other post.



  • nima_API

    Look at the cancel property in the help file. What happens when you press the escape key (you should get the same message). It looks like you have have inherited code from a class. Take a look at the parent class of you command button, look at the error routines associated with your command button and or form. Try creating a form and cancel button in a clean environment, what are the results Set up trace mode in your debugger, what do you see
  • Christina

    Alex,

    None of those messages are default VFP dialogs. Fix your handler. IOW it is a bug in your own application.


  • Cancel Button Does not work--A known bug?