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
Solved

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

Posted on 1998-09-09
8
314 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
Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

 

Author Comment

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

Do I specify an Unit in "uses" ?

0
 

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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

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…
Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
Established in 1997, Technology Architects has become one of the most reputable technology solutions companies in the country. TA have been providing businesses with cost effective state-of-the-art solutions and unparalleled service that is designed…

809 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