Re: [fpc-devel] Publish some of FPC's internal cross-platform functionality

2019-03-09 Thread Michael Van Canneyt
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

Re: [fpc-devel] Publish some of FPC's internal cross-platform functionality

2019-03-09 Thread Marco van de Voort
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

Re: [fpc-devel] Publish some of FPC's internal cross-platform functionality

2019-03-09 Thread Anton Shepelev
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

Re: [fpc-devel] Publish some of FPC's internal cross-platform functionality

2019-03-09 Thread 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.: Program Test; uses TextDrv, SysUtils; var t: Text; s: AnsiString; h: THandle; begin h := FileOpen( 'C:\test.txt', fmOpenRead );

Re: [fpc-devel] Publish some of FPC's internal cross-platform functionality

2019-03-09 Thread Marco van de Voort
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" ?

Re: [fpc-devel] "Blank slate" next version of FPC

2019-03-09 Thread Nikolai Zhubr
Hi, 09.03.2019 21:06, Anton Shepelev: [...] Pascal is a language where declaration and use of variables is separated. It makes it easy to see what [...] a := a + Func1( b ); int b := Func2( a ); a := a - Func3( b ); Also worth reference are Bart's thoughts on the subject, in two

Re: [fpc-devel] Publish some of FPC's internal cross-platform functionality

2019-03-09 Thread Michael Van Canneyt
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

Re: [fpc-devel] Publish some of FPC's internal cross-platform functionality

2019-03-09 Thread Anton Shepelev
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

Re: [fpc-devel] Publish some of FPC's internal cross-platform functionality

2019-03-09 Thread Sven Barth via fpc-devel
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 >

Re: [fpc-devel] "Blank slate" next version of FPC

2019-03-09 Thread Anton Shepelev
Sven Barth: > Pascal is a language where declaration and use of > variables is separated. It makes it easy to see what > variables are declared and what type they are. Inline > variables mess this up as a variable can be declared > somewhere inside the code. I use C++ to earn my living. I >

Re: [fpc-devel] Publish some of FPC's internal cross-platform functionality

2019-03-09 Thread Michael Van Canneyt
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:

[fpc-devel] Publish some of FPC's internal cross-platform functionality

2019-03-09 Thread Anton Shepelev
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: