home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Power-Programmierung
/
CD1.mdf
/
magazine
/
pcmagazi
/
1991
/
08
/
unique.pas
< prev
Wrap
Pascal/Delphi Source File
|
1991-03-25
|
1KB
|
44 lines
PROGRAM Unique;
USES Dos, Crt;
CONST AG : ARRAY[0..35] OF CHAR =
'0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ';
{these are the "asciiGesimal characters}
VAR OneName : NameStr;
FUNCTION UniqueName : NameStr;
VAR Year, Month, Day, Dummy,
Hour, Min, Sec : Word;
temp : NameStr;
BEGIN
GetDate(Year, Month, Day, dummy);
GetTime(Hour, Min, Sec, dummy);
temp := AG[year-1980]+AG[Month]+AG[Day]+AG[Hour];
temp := temp+AG[Min DIV 10]+AG[Min MOD 10]+
AG[Sec DIV 10]+AG[Sec MOD 10];
UniqueName := temp;
END;
PROCEDURE When(Name : NameStr);
VAR Year, Month, Day,
Hour : Word;
Min, Sec : String[2];
BEGIN
year := pred(pos(name[1], AG)) + 80;
month := pred(pos(name[2], AG));
day := pred(pos(name[3], AG));
Hour := pred(pos(name[4], AG));
Min := Copy(name,5,2);
Sec := Copy(name,7,2);
Write('Filename: ',name,' Date/Time: ');
WriteLn(month,'/',day,'/',year,' ',hour,':',min,':',sec);
END;
BEGIN
REPEAT
OneName := UniqueName;
When(UniqueName);
Delay(500);
UNTIL KeyPressed;
END.