Difference between revisions of "Unit GlobalConfig"

From Ultibo.org
Jump to: navigation, search
Line 299: Line 299:
 
<pre style="border: 0; padding-bottom:0px;">procedure SetLastError(LastError:LongWord); inline;</pre>
 
<pre style="border: 0; padding-bottom:0px;">procedure SetLastError(LastError:LongWord); inline;</pre>
 
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Set the last error code for the current thread</div>
 
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Set the last error code for the current thread</div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
! '''Note'''
 +
| ''None applicable''
 +
|-
 +
|}
 +
</div></div>
 +
<br />
 +
 +
'''Conversion functions'''
 +
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;">
 +
<pre style="border: 0; padding-bottom:0px;">function ErrorToString(Error:LongWord):String;</pre>
 +
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Convert an error code value to a string</div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
! '''Note'''
 +
| ''None applicable''
 +
|-
 +
|}
 +
</div></div>
 +
<br />
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;">
 +
<pre style="border: 0; padding-bottom:0px;">function SysErrorToString(ErrorCode:Integer):String;</pre>
 +
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Convert an error code value to a string (RTL)</div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
! '''Note'''
 +
| ''None applicable''
 +
|-
 +
|}
 +
</div></div>
 +
<br />
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;">
 +
<pre style="border: 0; padding-bottom:0px;">function BooleanToString(Value:Boolean):String;</pre>
 +
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Convert a boolean value to a string</div>
 
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"

Revision as of 06:41, 21 September 2016

Return to Unit Reference


Description


The GlobalConfig unit contains variables used throughout Ultibo core to provide configuration and parameters to common modules and sub systems. Many of these variables may also be passed on the command line as environment variables to customize the behavior of Ultibo core without needing to recompile the application. This unit also includes a small number of widely used common functions.

Constants


None defined

Type definitions


None defined

Public variables


To be documented

GetLastErrorHandler:TGetLastError; - Registered handler for the global GetLastError function
SetLastErrorHandler:TSetLastError; - Registered handler for the global SetLastError function

Function declarations



Global functions

[Expand]
function Min(A,B:LongInt):LongInt; inline;
Description: Return the minimum value of A and B


[Expand]
function Max(A,B:LongInt):LongInt; inline;
Description: Return the maximum value of A and B


[Expand]
function Clamp(Value,Low,High:LongInt):LongInt;
Description: To be documented


[Expand]
function RoundUp(Value,Multiple:LongWord):LongWord;
Description: Round Value to the next highest multiple of Multiple


[Expand]
function RoundDown(Value,Multiple:LongWord):LongWord;
Description: Round Value to the next lowest multiple of Multiple


[Expand]
function DivRoundClosest(Value,Divisor:LongInt):LongWord;
Description: To be documented


[Expand]
function HIWORD(L:LongInt):Word; inline;
Description: Return the high word of L


[Expand]
function LOWORD(L:LongInt):Word; inline;
Description: Return the low word of L


[Expand]
function HIBYTE(W:LongInt):Byte; inline;
Description: Return the high byte of W


[Expand]
function LOBYTE(W:LongInt):Byte; inline;
Description: Return the low byte of W


[Expand]
function MAKELONG(A,B:LongInt):LongInt; inline;
Description: Make a longword value from A and B


[Expand]
function MAKEWORD(A,B:LongInt):Word; inline;
Description: Make a word value from A and B


[Expand]
function WordNtoBE(Value:Word):Word; inline;
Description: Convert word Value from native to big endian


[Expand]
function WordNtoLE(Value:Word):Word; inline;
Description: To be documented


[Expand]
function WordLEtoN(Value:Word):Word; inline;
Description: To be documented


[Expand]
function LongWordNtoLE(Value:LongWord):LongWord; inline;
Description: To be documented


[Expand]
function LongWordLEtoN(Value:LongWord):LongWord; inline;
Description: To be documented


[Expand]
function Int64NtoLE(const Value:Int64):Int64; inline;
Description: To be documented


[Expand]
function Int64LEtoN(const Value:Int64):Int64; inline;
Description: To be documented


[Expand]
function BCDtoBin(Value:Byte):Byte; inline;
Description: To be documented


[Expand]
function BintoBCD(Value:Byte):Byte; inline;
Description: To be documented


[Expand]
function GetLastError:LongWord; inline;
Description: Return the last error code for the current thread


[Expand]
procedure SetLastError(LastError:LongWord); inline;
Description: Set the last error code for the current thread


Conversion functions

[Expand]
function ErrorToString(Error:LongWord):String;
Description: Convert an error code value to a string


[Expand]
function SysErrorToString(ErrorCode:Integer):String;
Description: Convert an error code value to a string (RTL)


[Expand]
function BooleanToString(Value:Boolean):String;
Description: Convert a boolean value to a string


Return to Unit Reference