Walter Meester
HoogkarspelPays-Bas
Information générale
Catégorie:
Gestionnaire d'écran & Écrans
Daniel,
> Thank you for your help.
> I saw your code. It's cool when it's running along. But the problem is how you bind it into an existing application without lose any
>of it's original funtionality.
> Since one application can only have ONE "Read Events" and "Clear Event". When I try to combine your code into another application I
>got the following problem:
> 1. I can't use the program to load form since it has "Read Events" in it. But if I move the code (eg. &c___commands) into form,
>I got the problem I described before: It works fine for sql statements and foxpro functions, but it can't see any variable I created
>on command line (eg, if you type in "a=5" then "?a" you'll get error "Variable A not found in Keypress...").
The problem is that the commands must be executed at the lowest callstack level in order to prevent variables falling out of scope. Therefore I needed the trick to CLEAR the EVENTS and execute the command at the lowest program level.
Indeed the side effect is that it is fairly difficult to include it in your application. Personally, since my applications should hide this functionality from most users (I don't want them to screw thing up), I start the command window when the application was called with the C parameter: MYAPPLICATION.EXE starts the normal application. MYAPPLICATION C starts the command window.
I can imagine that this won't fit your needs. You may try to change the DO WHILE loop arround the READ EVENTS and exit the loop when you exit your application in the regular way (and not when a command is typed in). So using this READ EVENTS for your whole application.
>2. Your code will fall into infinite loop if I type "Enter" key twice.
>
> Maybe it's not a big issue but I'm just wondering why that happen.
> Hope you can help again.
I can't reproduce this behaviour, can you explain your steps a bit further ?
Walter,
Précédent
Suivant
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement