Solved

Procedures

Posted on 1997-10-31
5
203 Views
Last Modified: 2010-04-04
I have a Procedure that calls two other procedures

eg

Procedure TForm.Button1Click(Sender:TObject);
begin
  GetOutputFile(CurrentFile);
  DrawCoords(Sender);
end;

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
0
Comment
Question by:Ham
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
5 Comments
 
LVL 3

Expert Comment

by:mirek071497
ID: 1349228
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.
0
 
LVL 3

Expert Comment

by:mirek071497
ID: 1349229
What do you say ????
0
 

Author Comment

by:Ham
ID: 1349230
Hi

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.

JB
0
 
LVL 5

Expert Comment

by:JimBob091197
ID: 1349231
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.
0
 
LVL 2

Accepted Solution

by:
alona041797 earned 50 total points
ID: 1349232
Please send us the code of GetOutputFile.

0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an antispam), the admini…
This video shows how to use Hyena, from SystemTools Software, to update 100 user accounts from an external text file. View in 1080p for best video quality.

734 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question