VFPNewbie


I have a program that scans through a table and when it hits a condition will call a form. The problem is that it runs the form and then continues scanning when I need it to wait for the user to complete the form before moving on. I'm calling it with the DO FORM method and can't find anything on it, please help.



Re: do form and wait

dni


You may try to put

READ EVENTS

after DO FORM, and in "Exit" Form button (click method) you need to have

CLEAR EVENTS. In this way program will wait for form completion.







Re: do form and wait

VFPNewbie

READ EVENT doesn't work, and the CLEAR EVENT will shut down the main program that calls the form. Is this how it's usually done





Re: do form and wait

dni

CLEAR EVENTS at form close will return the program exactly after "DO FORM..." and clear READ EVENTS. It should work...




Re: do form and wait

Alex Feldstein

So you want a program that runs ahd at some point it stops to show a form, then waits until the form is closed to continue processing (with presumably some data gathered from the form)

You could make the form Modal (1)

*** main.prg ***

* run whatever code

DO FORM FormName |  [NAME VarName [LINKED]] [WITH cParameterList]
  [TO VarName] [NOREAD] [NOSHOW]
 
See: http://msdn.microsoft.com/library/default.asp url=/library/en-us/dv_foxhelp9/html/a727f12a-4d9f-45ca-aa01-c1bea7de9749.asp frame=true
 




Re: do form and wait

Lakshmi N

you can slightly change the logic

use a do while loop to hit particular record

when program hits the record please use exit stmt to go out of loop

outside do while loop have command do form

have a flag which stores that these records have been processed

once the user clicks exit in form do the scanning procedure again

but your scanning procedure should always run only for flag = 'N' i.e. the records which are not processed






Re: do form and wait

AndyKr

Make the Form MODAL (WindowType = 1) that will stop execution of the code on the "DO FORM" line until the form closes