Re: pascal equivalent of python "sleep"



On 8 Mai, 01:42, Sean McIlroy <sean_mcil...@xxxxxxxxx> wrote:
hi all

i'm trying to brush up my pascal skills after considerable time away.
in python there's a function "sleep" that essentially means "count
your toes for <number> seconds". how does one say this in pascal?

As you can see from the other answers, there
is no 'sleep' in standard Pascal. Therefore it
depends on your compiler and/or operating system.
The 'sleep' function itself has it's roots in the
C / UNIX world.

With such tings as 'sleep' and many other functionality
your program will depend on your Pascal compiler and
become unportable. This is a sad story. If you want
to write portable programs (which run under various
operating systems and compilers) you will have a hard
time doing it in Pascal. Pascal was my favorite language
for approx. 10 years. Such things as otherwise/else
clauses and file buffer variables not consistent between
different compilers make portability hard.

That I still admire Pascal's concepts can be seen
when you look at Seed7. The statements are in the
Pascal/Modula/Ada tradition. BTW. Seed7 does have a
'time.s7i' library which contains the types 'time' and
'duration' and the 'wait' function (which gets a
'duration' as parameter). So you can just do:
wait(1 . SECONDS);

Greetings Thomas Mertes

Seed7 Homepage: http://seed7.sourceforge.net
Seed7 - The extensible programming language: User defined statements
and operators, abstract data types, templates without special
syntax, OO with interfaces and multiple dispatch, statically typed,
interpreted or compiled, portable, runs under linux/unix/windows.
.