Re: [fpc-pascal] Negative RTL Error Codes in Some Platforms

2010-06-10 Thread Bihar Anwar
On June 10, 2010 6:12:42 PM, Tomas Hajny wrote: >OK, this is a slightly different story then. Win32 API function FindFirst >(and thus also the Delphi function FindFirst provided in SysUtils) returns >the "search handle" (positive value) in case of a success and -1 in case >of an error. The implem

Re: [fpc-pascal] Negative RTL Error Codes in Some Platforms

2010-06-10 Thread Tomas Hajny
On Thu, June 10, 2010 12:01, Bihar Anwar wrote: > On June 10, 2010 1:46:39 PM, Tomas Hajny wrote: . . >>However, you shouldn't rely on the returned values >>too much anyway. > > No, I just rely on such a returned values in a very few cases. For > example, In Windows/OS2/DOS, when FindNext() encou

Re: [fpc-pascal] Negative RTL Error Codes in Some Platforms

2010-06-10 Thread Bihar Anwar
On June 10, 2010 1:46:39 PM, Tomas Hajny wrote: >If I remember correctly, it's been done in order to differentiate standard >error codes (supposedly cross-platform and mostly inherited from TP/BP) >from all other error codes which may be triggered there and which are >completely platform specif

Re: [fpc-pascal] Negative RTL Error Codes in Some Platforms

2010-06-09 Thread Tomas Hajny
On Thu, June 10, 2010 05:44, Bihar Anwar wrote: > I look at the FPC RTL source codes and notice that in some OSes (e.g. > OS/2, DOS) every RTL functions which call OS API functions will return the > OS error code as a negative number. What is the reason behind this? I > don't find such a convention

[fpc-pascal] Negative RTL Error Codes in Some Platforms

2010-06-09 Thread Bihar Anwar
I look at the FPC RTL source codes and notice that in some OSes (e.g. OS/2, DOS) every RTL functions which call OS API functions will return the OS error code as a negative number. What is the reason behind this? I don't find such a convention in the official documentation of thouse OSes.