Solved

Procedures

Posted on 1997-10-31
5
200 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
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

U.S. Department of Agriculture and Acronis Access

With the new era of mobile computing, smartphones and tablets, wireless communications and cloud services, the USDA sought to take advantage of a mobilized workforce and the blurring lines between personal and corporate computing resources.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Windows Drag & Drop Location 2 100
delphi prevent click fast 2 219
LAN or WAN ? 11 91
How to save the image in the .cds File ClientDataSet? 1 12
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…
Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

777 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