Re: [fpc-pascal] possible bug in blockwrite

2023-03-05 Thread Bart via fpc-pascal
On Sun, Mar 5, 2023 at 7:02 PM Travis Siegel via fpc-pascal wrote: > On tp, I could open a file with a blocksize of 1, > > reset(file1,1); > ... > For example. > > Let's say I have a 5 byte string: > > st1 := '12345'; > > Now, if I blockwrite this to the file under tp: > > blockwrite(f1,st1);

Re: [fpc-pascal] possible bug in blockwrite

2023-03-05 Thread Vojtěch Čihák via fpc-pascal
Hi,   you can use PChar, or string+retype to PChar in blockwrite:    BlockWrite(f1, PChar(s)^, length(s));    which gives expected result. V. __ Od: "Travis Siegel via fpc-pascal" Komu: "FPC-Pascal users discussions" Datum: 05.03.2023

[fpc-pascal] possible bug in blockwrite

2023-03-05 Thread Travis Siegel via fpc-pascal
I'm using FPC 3.2.0, though I doubt anything changed in the most recent releases, though I'll try those if folks think it's worth doing so. What I ran across yesterday while doing a search for other things was some posts about updating a single line in a file using free pascal.  The solutions