I wrote:
> system.inc defines FileFunc as a procedure without a
> return value:
>
>FileFunc = Procedure(var t : TextRec);
>
> whereas streamio.pp defines the same operations as
> functions returning longint, e.g.:
>
>Function StreamRead(var F: TTextRec) : longint;
Here are the relevant
I wrote:
>> > Notice also that FreePascal's TextRec handling is
>> > incompatible with that of Delphi. The TextRec
>> > operations OpenFunc, InOutFunc, FlushFunc, and CloseFunc
>> > return a longint, which Delphi interprets as the result
>> > code but FreePascal ignores. Therefore, I must set
Sven Barth to Anton Shepelev:
> > Writers of drivers for this Pascal-style I/O interface
> > should have the ability to convert OS-specific error
> > codes into InOurRes values, which are not even
> > documented at:
> >
> >https://www.freepascal.org/docs-html/rtl/system/inoutres.html
>
>
Anton Shepelev schrieb am Mo., 11. März 2019, 15:12:
> Sven Barth to Anton Shepelev:
>
> >>Since we already have cross-platform functions FileRead
> >>and FileWrite, would not it be useful to have them set the
> >>InOutRes variable, or to publish a facility for converting
> >>the value of
Sven Barth to Anton Shepelev:
>>Since we already have cross-platform functions FileRead
>>and FileWrite, would not it be useful to have them set the
>>InOutRes variable, or to publish a facility for converting
>>the value of GetLastOSError into an InOutRes value?
>
>The usage of InOutRes is only
Am 10.03.2019 um 11:43 schrieb Anton Shepelev:
Michael Van Canneyt to Anton Shepelev:
Thank you, but how do I translate the return value of
GetLastOSError into a value of InOutRes? The
translation functions are privately implemented in
sysos.inc .
You can copy them. It is open source, after
Michael Van Canneyt to Anton Shepelev:
> > Thank you, but how do I translate the return value of
> > GetLastOSError into a value of InOutRes? The
> > translation functions are privately implemented in
> > sysos.inc .
>
> You can copy them. It is open source, after all.
Which brings us back to
On Sat, 9 Mar 2019, Anton Shepelev wrote:
Michael Van Canneyt about FileWrite and FileRead:
For these functions, you can get more info with
GetLastOSError, and use that to set InOutRes.
Thank you, but how do I translate the return value of
GetLastOSError into a value of InOutRes? The
Op 2019-03-09 om 21:45 schreef Anton Shepelev:
Marco van de Voort:
Really? So why can't you simply use untyped "file"?
I am writing a TextRec driver that shall work with a bare
THandle, e.g.:
Use (objpas.) fileread and filewrite
Michael Van Canneyt about FileWrite and FileRead:
> For these functions, you can get more info with
> GetLastOSError, and use that to set InOutRes.
Thank you, but how do I translate the return value of
GetLastOSError into a value of InOutRes? The translation
functions are privately implemented
Marco van de Voort:
> Really? So why can't you simply use untyped "file"?
I am writing a TextRec driver that shall work with a bare
THandle, e.g.:
Program Test;
uses TextDrv, SysUtils;
var
t: Text;
s: AnsiString;
h: THandle;
begin
h := FileOpen( 'C:\test.txt', fmOpenRead );
Op 2019-03-09 om 18:09 schreef Anton Shepelev:
FreePascal has many low-level cross-platform functions
scattered over multiple .inc files but not consolilated into
reusable cross-platform units. Consider, for example, the
functions
Really? So why can't you simply use untyped "file" ?
On Sat, 9 Mar 2019, Anton Shepelev wrote:
Michael Van Canneyt to Anton Shepelev:
> function do_read (h: longint; addr: pointer; len:
> longint) : longint; function do_write(h: longint; addr:
> pointer; len: longint) : longint;
I also don't see why you need this. You have this
Michael Van Canneyt to Anton Shepelev:
> > function do_read (h: longint; addr: pointer; len:
> > longint) : longint; function do_write(h: longint; addr:
> > pointer; len: longint) : longint;
>
> I also don't see why you need this. You have this
> functionality available in a cross-platform
Anton Shepelev schrieb am Sa., 9. März 2019, 18:09:
> It would relieve the programmer of writing conditionally
> compiled OS-specific code sections for such basic operations
> as are already implemented in FreePascal's internals. I,
> for example, have to do it whenever my Windws/Unix program
>
On Sat, 9 Mar 2019, Anton Shepelev wrote:
Hello, all
FreePascal has many low-level cross-platform functions
scattered over multiple .inc files but not consolilated into
reusable cross-platform units. Consider, for example, the
functions
function do_read (h: longint; addr: pointer; len:
Hello, all
FreePascal has many low-level cross-platform functions
scattered over multiple .inc files but not consolilated into
reusable cross-platform units. Consider, for example, the
functions
function do_read (h: longint; addr: pointer; len: longint) : longint;
function do_write(h:
17 matches
Mail list logo