I have a Procedure that calls two other procedures


Procedure TForm.Button1Click(Sender:TObject);

The problem is that the procedure DrawCoords executes BEFORE the procedure GetOutPutFile is finished. Where I want it to execute after GetOutPutFile is finished. DrawCoords ends up reading blank information from a StringGrid because GetOutPutFile hasnt finished reading the file and writing it to the StringGrid. So basically I want DrawCoord to wait momenterily
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

You are on wrong way.
GetOutputFile(CurrentFile) must finished to execute DrawCoords(Sender).
You must place here some code from GetOutputFile(CurrentFile).
I think so your error is there.
What do you say ????
HamAuthor Commented:

There is something wrong here.  A Delphi procedure cannot execute until the one before it has finished.  An exception would be if GetOutputFile starts a thread.  In that case, GetOutputFile could finish, and DrawCoords could start before the thread has started/initialized.

As Mirek asked, please could you give us the code from GetOutputFile.

GetOutputFile starts something asynchroniusly (a thread of some kind; maybe calls an async method of a component). You should put DrawCoords in the EVENT generated when the thread (or async method) completes.
Please send us the code of GetOutputFile.


Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.