Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
|
|
@ -0,0 +1,38 @@
|
|||
{$mode delphi}
|
||||
PROGRAM notes;
|
||||
// Notes: a time-stamped command line notebook
|
||||
// usage: >notes "note"< or >notes< to display contents
|
||||
USES Classes, SysUtils;
|
||||
|
||||
VAR
|
||||
Note : TStringList;
|
||||
Fname : STRING = 'Notes.txt';
|
||||
Dtime : STRING;
|
||||
Ntext : STRING;
|
||||
c : Cardinal;
|
||||
|
||||
BEGIN
|
||||
DTime := FormatDateTime('YYYY-MM-DD-hhnn',Now);
|
||||
Note := TStringList.Create;
|
||||
WITH Note DO BEGIN
|
||||
TRY
|
||||
LoadFromFile(Fname);
|
||||
EXCEPT
|
||||
Add(DTime);
|
||||
NText := 'Notes.txt created.';
|
||||
END;
|
||||
// command line args present:
|
||||
// add note with date & time
|
||||
IF ParamStr(1) <> '' THEN BEGIN
|
||||
NText := ParamStr(1);
|
||||
Add(DTime);
|
||||
Add(NText);
|
||||
SaveToFile(Fname);
|
||||
// command line args absent:
|
||||
// display contents of notebook
|
||||
END ELSE
|
||||
FOR c := 0 TO Count-1 DO
|
||||
Writeln(Note[c]);
|
||||
Free;
|
||||
END;
|
||||
END.
|
||||
Loading…
Add table
Add a link
Reference in a new issue