[fpc-pascal] How to append data to a file of byte?

2018-10-14 Thread Bo Berglund
It seems like I cannot use Append() on a file of byte. Neither is it allowed to use SeekEOF() on that file type... I want to log binary data to a logfile and therefore I need to open it for writing with record size =1 and the file pointer at the eof location. But all of the useful functions seem o

Re: [fpc-pascal] How to append data to a file of byte?

2018-10-14 Thread Michael Van Canneyt
On Sun, 14 Oct 2018, Bo Berglund wrote: It seems like I cannot use Append() on a file of byte. Neither is it allowed to use SeekEOF() on that file type... I want to log binary data to a logfile and therefore I need to open it for writing with record size =1 and the file pointer at the eof loc

[fpc-pascal] Parse strings like "day-1" to convert in a time stamp

2018-10-14 Thread Marcos Douglas B. Santos
Do you know any Pascal lib to parse strings to convert in date/time values? The user is supposed to type human-friendly values like: - "day"=> trunc(now) - "day-2" => trunc(now-2) - "week" => trunc(now-7) - "yesterday" => trunc(now-1) - etc... But they could type even their computer date format

Re: [fpc-pascal] How to append data to a file of byte?

2018-10-14 Thread Bo Berglund
On Sun, 14 Oct 2018 15:50:56 +0200 (CEST), in gmane.comp.compilers.free-pascal.general you wrote: >> This throws an error at SeekEof: >> >> AssignFile(F, FileName); >> if AppendToFile then >>SeekEof(F) >> else >>Rewrite(F,1); >> BlockWrite(F, Buf[0], Length(Buf)); >> CloseFile(F); >

Re: [fpc-pascal] Parse strings like "day-1" to convert in a time stamp

2018-10-14 Thread Sven Barth via fpc-pascal
Marcos Douglas B. Santos schrieb am So., 14. Okt. 2018, 16:15: > Do you know any Pascal lib to parse strings to convert in date/time values? > The user is supposed to type human-friendly values like: > - "day"=> trunc(now) > - "day-2" => trunc(now-2) > - "week" => trunc(now-7) > - "yesterday"

Re: [fpc-pascal] Parse strings like "day-1" to convert in a time stamp

2018-10-14 Thread Michael Van Canneyt
On Mon, 15 Oct 2018, Sven Barth via fpc-pascal wrote: Marcos Douglas B. Santos schrieb am So., 14. Okt. 2018, 16:15: Do you know any Pascal lib to parse strings to convert in date/time values? The user is supposed to type human-friendly values like: - "day"=> trunc(now) - "day-2" => tru