Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Replace All while not plStop
Message
 
 
À
27/06/2002 11:44:22
Dragan Nedeljkovich (En ligne)
Now officially retired
Zrenjanin, Serbia
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00672137
Message ID:
00672931
Vues:
7
>
>>>if m.SomeMemVar
>>>   replace FieldX with m.Val1 ;
>>>      for some_other_expression ;
>>>      while [TableX.]Cust_ID = m.nCust_ID
>>>endif
>>
>>I want to be able to stop the process.
>>
>>So, I have something like this
>>ON ESCAPE plStop = messagebox('Are you sure you want to stop replace process?,36,'Stop process')=6
>>
>>So, user can hit ESC and the process would be stopped.
>>
>>That's the idea, and it similar to Sergey's SCAN solution, but SCAN is slower than one replace command.
>>
>>However, WHILE clause always makes the process to start from the current record, and I was not aware of it (or didn't realize it). So, in order to fix the problem my colleague put GO TOP at the top on the command button Click method. Unfortunately, there are multiple replaces under certain conditions, so this is still a partial solution...
>
>Escape could fire only between commands - I don't think you can get it to fire during a replace. Besides, I wouldn't really rely on messagebox, it gets you out of the VFP event loop and executes somewhere outside of it (it's just a Windows service and gets its own window which seems to be not a child of VFP's window).
>
>Did you really get this to fire? I remember that back in FoxPlus days I used to interrupt long replaces with escape, so maybe it still would. You may try with something natively fox, not messagebox - maybe
>
ON ESCAPE plStop =empty(inputbox("..."....))
Yes, it does work. Sometimes not immediatelly, but it does allow me to answer Yes or No and in case of No continues the replace process...

SCAN ENDSCAN would be more common approach, and may be we'll switch to it shortly... It will degradate the performance, though...

I'm going to set a meeting with my colleague and my manager in order to discuss Global Editor form.

We currently have three applications, which use Global Editor form, and in each case the application uses its own version. We didn't design it as a class...

I want to propose to create one class for this and closely revise each method.
If it's not broken, fix it until it is.


My Blog
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform