Difference between revisions of "sysutils"
(expand) |
(expand) |
||
Line 8: | Line 8: | ||
== notable functionality == | == notable functionality == | ||
* [[Format function|<syntaxhighlight lang="pascal" inline>format</syntaxhighlight>]] | * [[Format function|<syntaxhighlight lang="pascal" inline>format</syntaxhighlight>]] | ||
+ | * [[Executing External Programs#SysUtils.ExecuteProcess|<syntaxhighlight lang="pascal" inline>executeProcess</syntaxhighlight> for executing external programs]] | ||
+ | * several routines making [[TDateTime|<syntaxhighlight lang="pascal" inline>tDateTime</syntaxhighlight>]] usable | ||
* {{Doc|package=RTL|unit=sysutils|identifier=typehelpers|text=type helpers for all basic data types}} | * {{Doc|package=RTL|unit=sysutils|identifier=typehelpers|text=type helpers for all basic data types}} | ||
Line 13: | Line 15: | ||
{{Doc|package=RTL|unit=system|identifier=runtimeerrors|text=If the <syntaxhighlight lang="pascal" inline>sysUtils</syntaxhighlight> unit is included}}, all [[runtime error|run-time errors]] become [[Exceptions|exceptions]], thus virtually forcing you to use a [[Compiler Mode|compiler mode]] (or [[modeswitch|mode switch]]) that allows exception treatment. | {{Doc|package=RTL|unit=system|identifier=runtimeerrors|text=If the <syntaxhighlight lang="pascal" inline>sysUtils</syntaxhighlight> unit is included}}, all [[runtime error|run-time errors]] become [[Exceptions|exceptions]], thus virtually forcing you to use a [[Compiler Mode|compiler mode]] (or [[modeswitch|mode switch]]) that allows exception treatment. | ||
You will need to include <syntaxhighlight lang="pascal" inline>sysUtils</syntaxhighlight> in every unit that may throw an exception just to familiarize with the exception classes, even though the unit itself does not use any actual code of it. | You will need to include <syntaxhighlight lang="pascal" inline>sysUtils</syntaxhighlight> in every unit that may throw an exception just to familiarize with the exception classes, even though the unit itself does not use any actual code of it. | ||
+ | |||
+ | If [[Size Matters|size matters]], using <syntaxhighlight lang="pascal" inline>sysUtils</syntaxhighlight> is by design not the smartest choice. | ||
== see also == | == see also == | ||
* {{Doc|package=RTL|unit=sysutils|text=<syntaxhighlight lang="pascal" inline>sysUtils</syntaxhighlight> reference}} | * {{Doc|package=RTL|unit=sysutils|text=<syntaxhighlight lang="pascal" inline>sysUtils</syntaxhighlight> reference}} | ||
* [http://docwiki.embarcadero.com/Libraries/Sydney/en/System.SysUtils Delphi’s <syntaxhighlight lang="pascal" inline>sysUtils</syntaxhighlight> unit] | * [http://docwiki.embarcadero.com/Libraries/Sydney/en/System.SysUtils Delphi’s <syntaxhighlight lang="pascal" inline>sysUtils</syntaxhighlight> unit] | ||
− | * [[libc|<syntaxhighlight lang=" | + | * [[libc library|<syntaxhighlight lang="c" inline>libc</syntaxhighlight> library]] <!-- similar in design --> |
* [[System unit|<syntaxhighlight lang="pascal" inline>system</syntaxhighlight> unit]] | * [[System unit|<syntaxhighlight lang="pascal" inline>system</syntaxhighlight> unit]] |
Revision as of 17:07, 22 January 2021
│
English (en) │
Esperanto (eo) │
français (fr) │
The unit sysUtils
shipped with the FPC’s default run-time library provides a plethora of system utilities.
It attempts to be as compatible to Delphi’s sysUtils
unit as possible.
However, the FPC version is available on all platforms the FPC supports.
You will not find any Windows-related routines or other highly platform-specific functionality.
notable functionality
format
executeProcess
for executing external programs- several routines making
tDateTime
usable - type helpers for all basic data types
caveats
If the sysUtils
unit is included, all run-time errors become exceptions, thus virtually forcing you to use a compiler mode (or mode switch) that allows exception treatment.
You will need to include sysUtils
in every unit that may throw an exception just to familiarize with the exception classes, even though the unit itself does not use any actual code of it.
If size matters, using sysUtils
is by design not the smartest choice.