Sign in Join
Wiki copytemporary

sysutils

English · Esperanto · Français

The unit sysUtils shipped with the FPC’s default run-time library provides many system utilities. It attempts to be as compatible to Delphi’s sysUtils unit as possible. However, the FPC version is available on all platforms that the FPC supports. It does not contain any Windows-related routines or other highly platform-specific functionality.

Notable functionality

Caveats

If the sysUtils unit is included, all run-time errors become exceptions, which virtually forces you to use a compiler mode (or mode switch) that allows exception treatment. To catch an exception by its name you will need to include sysUtils, even though the module itself does not use any of the included system utilities.

Changing run-time errors to exceptions has a global effect. The following program will terminate with an uncaught exception, even though it does not list sysUtils in its uses-clause: The sysUtils unit is implicitly included via the strUtils unit:

pascal
program implicitSysUtilsCaveat(input, output, stdErr);
uses
    strUtils;
var
    x: file of char;
    c: char;
begin
    // deliberately cause an error for demonstration purposes
    read(x, c); 
end.

Also, if size matters, using sysUtils is by design not the smartest choice.

See also


From the Free Pascal wiki, page "sysutils", as it stood on 2021-02-06 after a change by Kai Burghardt, out of the wiki's dump of 2024-05-26. Copyright stays with the author who wrote it, according to the old wiki's Licensing page. If you have concerns about this material, message the admin.

Revision 1, last changed by WikiArchive .

Talk about this page

Nobody has opened a bench for this page yet. Sign in to open one.