Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 2008-12

Portable error messages

3 messages · 2 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Mark Morgan Lloyd

In Windows one can get standard error messages using e.g.

SysErrorMessage(GetLastError);

If there a portable way (e.g. for Linux and Windows) in FPC? If direct access to the function above is best practice for Windows is there am equivalent for Linux?

Mark Morgan Lloyd markMLl .AT. telemetry.co .DOT. uk [Opinions above are the author's, not those of his employers or colleagues]

Reply by email

Graeme Geldenhuys
to Mark Morgan Lloyd
Mark Morgan Lloyd wrote
SysErrorMessage(GetLastError); If there a portable way (e.g. for Linux and Windows) in FPC?

There is a SysUtils function called GetLastOSError(). it's cross-platform, but I don't know if it is implemented in all OS's. I know it is for Windows and Unix (which includes Linux).

Regards,
- Graeme -

_______________________________________________
fpGUI - a cross-platform Free Pascal GUI toolkit
http://opensoft.homeip.net/fpgui/

Reply by email

Mark Morgan Lloyd
to Graeme Geldenhuys
Graeme Geldenhuys wrote 10 lines
On Fri, Dec 5, 2008 at 1:36 AM, Mark Morgan Lloyd wrote: > SysErrorMessage(GetLastError); > > If there a portable way (e.g. for Linux and Windows) in FPC? There is a SysUtils function called GetLastOSError(). it's cross-platform, but I don't know if it is implemented in all OS's. I know it is for Windows and Unix (which includes Linux).

Thanks Graeme, got it. Looks like the other bit of the puzzle is also called SysErrorMessage().

Mark Morgan Lloyd markMLl .AT. telemetry.co .DOT. uk [Opinions above are the author's, not those of his employers or colleagues]

Reply by email