Initial data commit
This commit is contained in:
parent
72d218235f
commit
f23f22d71c
199087 changed files with 3378941 additions and 0 deletions
|
|
@ -0,0 +1,35 @@
|
|||
include xpllib; \Date and Time routines
|
||||
int I, NotesSize, Ch, CmdArgSize;
|
||||
char Notes(1_000_000), CmdArg(1000);
|
||||
[\Read in notes.txt, if it exists
|
||||
Trap(false); \disable abort on errors
|
||||
FSet(FOpen("notes.txt", 0), ^i);
|
||||
OpenI(3);
|
||||
if GetErr = 0 then \file exists
|
||||
[I:= 0;
|
||||
while GetErr = 0 do \GetErr detects end-of-file
|
||||
[Notes(I):= ChIn(3);
|
||||
I:= I+1;
|
||||
];
|
||||
NotesSize:= I-2; \remove 2 EOFs
|
||||
];
|
||||
\Get command-line argument, if any, from command line
|
||||
I:= 0;
|
||||
loop [Ch:= ChIn(8);
|
||||
if Ch = CR then quit;
|
||||
CmdArg(I):= Ch;
|
||||
I:= I+1;
|
||||
];
|
||||
CmdArg(I):= 0; \terminate string
|
||||
if I = 0 then \no args, just display notes.txt
|
||||
for I:= 0 to NotesSize-1 do ChOut(0, Notes(I))
|
||||
else \open notes.txt for output and append CmdArg
|
||||
[FSet(FOpen("notes.txt", 1), ^o);
|
||||
OpenO(3);
|
||||
for I:= 0 to NotesSize-1 do ChOut(3, Notes(I));
|
||||
DateOut(3, GetDosDate); ChOut(3, ^ );
|
||||
TimeOut(3, GetDosTime); CrLf(3);
|
||||
ChOut(3, Tab); Text(3, CmdArg); CrLf(3);
|
||||
Close(3);
|
||||
];
|
||||
]
|
||||
Loading…
Add table
Add a link
Reference in a new issue