Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

accustomed Pascal 7.0 user now into Delphi 2.0

Status
Not open for further replies.

leopardo

Technical User
May 14, 2005
18
AR
Hello World !!!.

Well, by ordinary I've done some nice programs in Pascal 7.0 , but recently I begun to use Delphi 2.0, a powerful tool without doubt. But I've encountered certain procedures which are easy to invoke and use in Pascal but hard or at least not intuitive to be implemented with Delphi 2.0.
Specifically, in Pascal 7.0 the Delay(t) procedure delays the code ejecution by t milliseconds, which is the necessary time for stepping motor does a little rotation for example, but in Delphi 2.0 I have no idea what procedure I could use with the same result, honestly. Can you help me ?.
Thanks buddy!.
 
You can use:
Code:
sleep(milliseconds);

example: sleep(10000) -> stop execution for 10 sec.

or you can write a function like this:

Code:
procedure TForm1.MySleep(dwMilliseconds: DWORD);
var Start: Cardinal;
begin
 Start := GetTickCount;
 while (GetTickCount - Start) < dwMilliseconds do Application.ProcessMessages;
end;

and invoke it when you need:

Code:
MySleep(10000);

Hope tis can help
Giovanni Caramia
 
Not trying to sink your ship but, I would strongly advise to get hold of Delphi 3, 4 , 5 or 6.
Delphi 2 was geared towards the 16 bit Windows 3.11 system. Win95 will still support it, but Windows-NT, 98 or ME can give problems.
Probably Win2000 and XP won't even run your programs, unless you make use of very simple components.

Steven
 
Or 7?
I dont know how much truth there is in the even number thing (some people say that the odd numbered versions are more stable). I have to say that I find D4 is more flakey than D3, but in general Steven is correct you should seriouly consider upgrading at least by one version,

D3 is very good you would be able to do most things with this the syntax is most simular to 2 (and turbo pascal) there are fewer licence restrictions, and you get some database components with the Standard version.

Disadvantges of V3 are:
Some of the syntax changes made in subsiquent versions (and addional library functions) could be considered to be improvments.
Debugging has improved quite a lot since version 3.




Steve:
A Delphi Programmer
A Feersum Endjinn indeed
 
THANKS you all !, I've read each reply with attention. Now I'm sure this is a very interesting and very interactive forum!!. For that one who advises about the operating system under Delphi 2.0 runs, I have to comment I used it in W98SE and till now no problems I found at run time.
Speciall Thanks to gcaramia for relpy me shortly in time, that code helps me well.

leopardo.
 
I said win98 etc. can give problems. Delphi 3 and up has the win32 components (treeview, listview, statusbar, imagelist, toolbar) and many more that are now standard in every windows application.

Steven
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top