Solved

Sleep in Delphi 3.0 with win95 but in Delphi 1.0 with win 3.11 ?

Posted on 1998-09-09
8
310 Views
Last Modified: 2010-04-06
I use the SLEEP function in Delphi 3.0 with win 95.
But I have to use a similar function with win 3.11.
Sleep doesn't exist under win 3.11.
Do exist a similar function under win 3.11?
Thanks.
0
Comment
Question by:nk51
8 Comments
 
LVL 5

Expert Comment

by:inter
ID: 1339110
You can use Delay with Delphi 1.0
0
 
LVL 2

Expert Comment

by:kjteng
ID: 1339111
You can also use GetTickCount API
0
 
LVL 5

Accepted Solution

by:
inter earned 50 total points
ID: 1339112
Sorry, I think there is no delay in delphi 1.0 but you can use the following (be sure to include WinProcs)

procedure Wait(Msec : longint);
var
  b : longint;
begin
  b := GetTickCount;
  while (GetTickCount - b) < Msec do
     Application.ProcessMessages;
end;

Regards,  igor


0
 

Author Comment

by:nk51
ID: 1339113
It doesn't work with delay.

Do I specify an Unit in "uses" ?

0
What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

 

Author Comment

by:nk51
ID: 1339114
It doesn't work with delay.

Do I specify an Unit in "uses" ?

0
 
LVL 4

Expert Comment

by:d003303
ID: 1339115
right, the uses clause specifies a list of used units. Just add WinProcs to it, like

uses Windows, Forms;
->
uses Windows, Forms, WinProcs;

Slash/d003303
0
 

Author Comment

by:nk51
ID: 1339116
Your procedure Wait is good.
Thanks.
0
 
LVL 5

Expert Comment

by:inter
ID: 1339117
You're wellcome ;-)
0

Featured Post

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
code issue 8 85
Connection between libmysql.dll and MySQL Versions 7 82
Printing problem 2 72
Delphi inherited method 6 42
Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.

760 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

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now