Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

clock

1 view
Skip to first unread message

Elaine Jackson

unread,
Dec 19, 2002, 9:24:23 AM12/19/02
to
Is there a function that returns the current value of the computer's clock?

TIA and Happy Holidays!
EJ


Dave Langers

unread,
Dec 19, 2002, 11:11:17 AM12/19/02
to

Use GetTime and/or GetDate from the Dos unit.

Markus Humm

unread,
Dec 19, 2002, 11:22:57 AM12/19/02
to
Elaine Jackson schrieb:

> Is there a function that returns the current value of the computer's clock?

In Turbo/Borland Pascal there is GETTIME. It's in the unit DOS. Look it
up in the help and all will be clear to you at once!

Greetings

Markus

CBFalconer

unread,
Dec 19, 2002, 8:01:34 PM12/19/02
to
Dave Langers wrote:
> Elaine Jackson wrote:
>
> > Is there a function that returns the current value of the computer's clock?
>
> Use GetTime and/or GetDate from the Dos unit.

This is cross-posted to comp.lang.pascal.ansi-iso. There are no
such functions, nor DOS units, in standard Pascal (to ISO7185).
However in Extended Pascal to ISO 10206 the following exists
(pasted as quote to avoid line wraps):

> 6.7.6.9 Time functions
>
> date(t)
>
> From the expression t that shall be of the type denoted by the required
> type-identifier TimeStamp, this function shall return a result of the
> canonical-string-type with an implementation-defined length. The function
> shall yield a value that is an implementation-defined representation of the
> calendar date denoted by the value of t. It shall be an error if the fields
> day, month, and year of t do not represent a valid calendar date.
>
> time(t)
>
> From the expression t that shall be of the type denoted by the required
> type-identifier TimeStamp, this function shall return a result of the
> canonical-string-type with an implementation-defined length. The function
> shall yield a value that is an implementation-defined representation of the
> time denoted by the value of t.

Note that a string is NOT what Borland considers a string.

--
Chuck F (cbfal...@yahoo.com) (cbfal...@worldnet.att.net)
Available for consulting/temporary embedded and systems.
<http://cbfalconer.home.att.net> USE worldnet address!


Dr John Stockton

unread,
Dec 20, 2002, 8:24:07 AM12/20/02
to
JRS: In article <3E0253B9...@yahoo.com>, seen in
news:comp.lang.pascal.ansi-iso,comp.lang.pascal.borland,comp.lang.pascal
.misc, CBFalconer <cbfal...@yahoo.com> posted at Fri, 20 Dec 2002
01:01:34 :-

>Dave Langers wrote:
>> Elaine Jackson wrote:
>>
>> > Is there a function that returns the current value of the computer's clock?
>>
>> Use GetTime and/or GetDate from the Dos unit.
>
>This is cross-posted to comp.lang.pascal.ansi-iso. There are no
>such functions, nor DOS units, in standard Pascal (to ISO7185).

This is cross-posted to comp.lang.pascal.ansi-iso,comp.lang.pascal.borla
nd,comp.lang.pascal.misc. Only the obtuse would do that to ask such a
question. Surely, there are no obtuse users of Standard Pascal?

--
© John Stockton, Surrey, UK. j...@merlyn.demon.co.uk Turnpike v4.00 MIME. ©
<URL:http://www.merlyn.demon.co.uk/> TP/BP/Delphi/&c., FAQqy topics & links;
<URL:http://www.merlyn.demon.co.uk/clpb-faq.txt> Pedt Scragg: c.l.p.b. mFAQ;
<URL:ftp://garbo.uwasa.fi/pc/link/tsfaqp.zip> Timo Salmi's Turbo Pascal FAQ.

CBFalconer

unread,
Dec 20, 2002, 6:43:00 PM12/20/02
to
Dr John Stockton wrote:
> CBFalconer <cbfal...@yahoo.com> posted at Fri, 20 Dec 2002
> >Dave Langers wrote:
> >>
> >> Use GetTime and/or GetDate from the Dos unit.
> >
> >This is cross-posted to comp.lang.pascal.ansi-iso. There are no
> >such functions, nor DOS units, in standard Pascal (to ISO7185).
>
> This is cross-posted to comp.lang.pascal.ansi-iso,comp.lang.pascal.borla
> nd,comp.lang.pascal.misc. Only the obtuse would do that to ask such a
> question. Surely, there are no obtuse users of Standard Pascal?

I think you miss the point, and apologies in advance if I miss
yours. I cannot remove the cross-posts, because I have no idea
from whence the original culprit posted. At most I could have set
followups to everything except c.l.p.a. However that is a long
and tedious, also error prone, procedure with my newsreader.

Elmware

unread,
Dec 29, 2002, 9:49:25 PM12/29/02
to
"Elaine Jackson" <elaineja...@home.com> took the time on, 19 Dec
2002, to amuse us all by posting to comp.lang.pascal.borland:
news:rEkM9.120400$Qr.31...@news3.calgary.shaw.ca:

Check this one out, that I made awhile back. I also made a cool calendar
that splits the last few cells on Sunday and Monday whenever the months end
on those days. If you want it bad enough, just ask for it, and I'll post
it, and the units needed for it.

-----
uses crt,dos,graph;

var Ch:char;
I:integer;
H,M,S,S100:word;
AngX,AngY:integer;
Height:integer;
Chime:boolean;

procedure Setup;
var GD,GM:integer;
begin
GD:=detect;
initgraph(GD,GM,'');
end;

procedure AngleLine(AX,AY:integer;Angle:real;LX,LY:integer);
var X1,Y1:integer;
begin
Angle:=((Angle-1)/43)*0.75;
X1:=round(AX+sin(Pi/180+Angle)*LX);
Y1:=round(AY+-Cos(Pi/180+Angle)*LY);
line(AX,AY,X1,Y1);
end;

procedure P_Line(AX,AY:integer; Angle:real; StX,STY,EnX,EnY:integer);
var X1,Y1,X2,Y2:integer;
begin
Angle:=((Angle-1)/43)*0.75;
X1:=round(AX+sin(Pi/180+Angle)*StX);
Y1:=round(AY+-Cos(Pi/180+Angle)*StY);
X2:=round(AX+sin(Pi/180+Angle)*EnX);
Y2:=round(AY+-Cos(Pi/180+Angle)*EnY);
line(X1,Y1,X2,Y2);
end;

procedure GetArcPointXY(AX,AY:integer;
Angle:real;
DistanceX,DistanceY:integer;
var PX,PY:integer);
var X1,Y1:integer;
begin
Angle:=((Angle-1)/43)*0.75;
X1:=round(AX+sin(Pi/180+Angle)*DistanceX);
Y1:=round(AY+-Cos(Pi/180+Angle)*DistanceY);
PX:=X1;
PY:=Y1;
end;

begin
Setup;
setcolor(15);
setfillstyle(1,15);
Ellipse(319,239,0,360,199,199);
floodfill(319,239,15);
setcolor(0);
for I:=0 to 59 do
P_Line(319,239,I*6,196,196,197,197);
setlinestyle(solidln,0,3);
setcolor(0);
for I:=0 to 12 do
P_Line(319,239,I*30,194,194,197,197);
setlinestyle(solidln,0,0);
while not keypressed do
begin
setcolor(15);
AngleLine(319,239,(H*30)+((M+1)*0.5),149,149);
AngleLine(319,239,(M*6)+((S+1)*0.1),169,169);
AngleLine(319,239,(S*6)+((S100+1)*0.06),179,179);
gettime(H,M,S,s100);
if (M<>0)and(M<>30) then Chime:=false;
if(M=0)and(Chime=false) then
begin
write(#7#7);
Chime:=true;
end;
if(M=30)and(Chime=false) then
begin
write(#7);
Chime:=true;
end;
setcolor(0);
AngleLine(319,239,(H*30)+((M+1)*0.5),149,149);
AngleLine(319,239,(M*6)+((S+1)*0.1),169,169);
setcolor(4);
AngleLine(319,239,(S*6)+((S100+1)*0.06),179,179);
delay(30);
end;
Ch:=readkey;
closegraph;
end.
-----

--
The pool on the roof must have sprung a leak.

0 new messages