home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
ftp.wwiv.com
/
ftp.wwiv.com.zip
/
ftp.wwiv.com
/
pub
/
MISC
/
TGARTS.ZIP
/
SAMPLE.ZIP
/
TGLAST.PAS
< prev
next >
Wrap
Pascal/Delphi Source File
|
1998-12-19
|
3KB
|
77 lines
Program TGLast;
Uses Crt, dtime;
{$I telegard.inc}
Var Last_File : File of Lcallers;
Last_Rec : Lcallers;
Filename : String;
Procedure ReaD_Laston;
Begin
Assign(Last_File, 'Laston.dat');
Reset(Last_File);
Read(Last_File, Last_Rec);
Close(Last_File)
end;
Procedure Make_Bulletin;
Var BullFile : Text;
Cnum,Temp,temp2: String;
ldt : datetimerec;
Begin
{Make a bulletin ouf ot the data (does not use all laston.dat fields}
Assign(BullFile, Filename+'.msg');
Rewrite(Bullfile); {Overwrites a file BE WARNED}
Writeln(BullFile, '`0E=-------------------------------------------=');
Writeln(BullFile, '`0F Telegard''s Last Caller ');
Writeln(BullFile, '`0D The last caller was : `0F'+last_rec.handle);
Str(last_rec.caller, cnum);
Writeln(BullFile, '`0E Caller #: `0F'+cnum+'`0E Real Name : `0D'+last_rec.realname);
Writeln(Bullfile, '`0C From: '+last_rec.location);
Str(last_rec.logonspeed, temp);
unix2dt(last_rec.logontime, ldt);
Writeln(Bullfile, '`0F');
str(ldt.day,temp); str(ldt.year,temp2);
Temp := 'User called on '+dlong[ldt.dow]+' '+mlong[ldt.month]+' '+temp+', '
+temp2+'.';
{This string takes apart the unixdate with a routine in the Dtime.pas
unit and I form the string together. You could use more items like
the hour and such however}
Writeln(Bullfile, '`0B'+temp);
Writeln(Bullfile, '`0E=-------------------------------------------=');
Close(Bullfile);
end;
Procedure Check_Input;
Begin
IF paramcount=0 then
Begin
Clrscr;Gotoxy(10,12);Textcolor(12);
Writeln('Error: Supply a filename with the program');
Writeln('Example TGLAST laston.msg');
Writeln('This creates the bulletin you supply');
Writeln('Through the command line TGLAST filename');
Writeln('Do NOT supply the extension, one of .msg will be given');
Writeln('Use a full drive and directory if you wish to place it elsewhere');
Writeln('Example c:\tg\text\laston.msg');
Writeln;Textcolor(10);
Writeln('*** Execution of program aborted ***');
Halt;
end;
If paramcount=1 then Filename := paramstr(1);
{No error checking for the filename like digits and such be advised}
end;
Begin
Check_Input;
Read_LastOn;
Make_Bulletin;
Writeln(paramstr(1)+'.msg has been created! Move it to your \text directory');
Writeln('to view online as a command or use a utilitiy like Tgtype.exe to view it.');
end.