Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Immadiate terminating of an SQL command
Message
De
03/09/1997 15:15:34
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00047916
Message ID:
00048342
Vues:
27
Hi Sorin!

You are right!
I always tested it in command mode. Thanks your advise!

BB

>Hi Bela!
>
>AFAIK, CANCELl will stop the execution of your application. Period.
>I never used this approach in a run-time EXE, but when I tested it in command mode, it exited to command mode where I believe that the event processing is still enabled. A runtime EXE will exit to the OS when Cancel is issued.
>
>Sorin
>
>>Hi Sorin!
>>
>>I didnot know this option of return. Thank you, for your suggestion!
>>The problem with cancel was, that it returns to highest level, which as I saw,
>>was event loop. Is it true?
>>
>>BB
>>
>>>This is a correction to PROC OnEsc
>>>...
>>>>IF lcOption $ "Yy"
>>>> RETURN TO myproc && instead of xx
>>>....
>>>Sorry.
>>>
>>>
>>>>Bela,
>>>>You don't have to Cancel the execution of the program to stop the SQL select.
>>>>Try this:
>>>>Put the following code in a PRG and run it. Either way it will return the control to myproc. The difference is that RETRY will branch back to the SQL statement and RETURN TO myproc will return to the line following the SQL statement. Of course, the code below can be improved:
>>>>
>>>>*PROC myproc
>>>>*************************
>>>>ON ESCAPE DO OnEsc IN myproc
>>>>** Your SQL SELECT statement here
>>>>WAIT WINDOW "This is the line following the SQL statement"
>>>>RETURN
>>>>
>>>>*************
>>>>PROC OnEsc
>>>>*************
>>>>lcOption = ""
>>>>WAIT WIND "Stop process ?" TO lcOption
>>>>IF lcOption $ "Yy"
>>>> RETURN TO xx
>>>>ELSE
>>>> RETRY
>>>>ENDIF
>>>>RETURN
>>>>
>>>>HTH
>>>>Sorin
>>>>
>>>>
>>>>>Hi Barbara!
>>>>>
>>>>>Thaks for your answer. Yes you are right, and I was a fool. But first I tried the way, that you wrote, the SQL statement was not terminated. Because, all the VFP documentation said, that issuing the Retry statement will continue the execution of last statement, but nowhere there was documented, that only an explicit Cancel will stop it. So this was my failure. After long trying, I get this:
>>>>>
>>>>>on escape do myproc
>>>>>
>>>>>procedure myproc
>>>>>if <>
>>>>> Retry && or nothing
>>>>>else && in case of cancel
>>>>> Cancel
>>>>>endif
>>>>>endproc
>>>>>
>>>>>
>>>>>BB
>>>>>
>>>>>>>Hi everybody!
>>>>>>>
>>>>>>>Do anybody know a way with there can be terminate a long SQL select, if the user press ESC or click on a PushButton?
>>>>>>>I thought on a dummy function which checks user input in SQL command, but what is the command, which terminate the SQL select?
>>>>>>>
>>>>>>>select *, dummy() ...
>>>>>>>
>>>>>>>function dummy
>>>>>>> if
>>>>>>>
>>>>>>> endif
>>>>>>>return .f.
>>>>>>>endfunc
>>>>>>>
>>>>>>>TIA
>>>>>>>
>>>>>>>BB
>>>>>>
>>>>>>Bela, just using the Escape key will stop an SQL-Select if you have SET ESCAPE ON. Just set this to ON before the SQL, and re-set to OFF afterwards if you usually have ESCAPE set to OFF.
>>>>>>
>>>>>>HTH
>>>>>>Barbara
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform