Built-in Units

SYSTEM

The system unit contains standard supported methods, constants, types and variables of Modern Pascal. Every application executed by Modern Pascal automatically inherit or use the SYSTEM unit without the need of the developer to reference it. We use the SYSTEM unit to expand the default "Pascal Grammar" to include the most commonly used routines.

Keywords

and
begin
break
case
class
const
constref
continue
default
dispose
div
do
downto
else
end
exit
except
external
finally
for
forward
function
goto
if
in
inline
label
mod
new
not
object
of
or
out
overload
override
packed
pred
private
procedure
program
record
repeat
set
shl
shr
sizeof
step
succ
swap
then
to
try
type
until
uses
var
while
with
xor
For the most part, the Keywords a.k.a. Reserved Words, are the actual core grammar of Pascal. Over the years the keywords list has grown a little because the system unit itself introduces so many useful methods (some documentation call keywords) to the application. A few of the keywords above are place holders for migration from other Pascal dialects. While others are native to Modern Pascal only. For example, inline is provided to allow some new pascal source code to run under Modern Pascal with no charges. However, inline has not valid use as all of your code is automatically inlined by the built-in optimizer when your code executes.

Globals

Array
AnsiChar
AnsiString
Boolean
Byte
ByteBool
Cardinal
Char
False
File
Integer
LineEnding
LargeInt
LargeWord
LongBool
LongInt
LongWord
Nil
No
Null
Off
On
PByte
PChar
Pointer
QWord
ShortInt
ShortString
SmallInt
String
TBoolArray
TBooleanArray
TByteArray
TCardinalArray
TCharArray
TDateTime
TExtendedArray
TextFile
TInt64Array
TIntegerArray
TReplaceFlags
True
TStringArray
TTimeStamp
TVariantArray
TWordArray
UnicodeString
WideString
Word
WordBool
Yes
Most of these globals are common to all Object-Oriented Pascal dialects. We have introduced things to make life easier for Database oriented developed like, Yes, No, On and Off for example. Because Modern Pascal is fully 64bit friendly, all 8bit, 16bit, 32bit, and 64bit types work on 32bit and 64bit CPUs with zero code changes or odd typing.

Function

AllocMem(Longint):Pointer
ApplicationName:String
Assigned(Constref):Boolean
BoolToStr(Boolean, String, String):String
Chr(Byte):Char
CleanStr(String):String
Copy(String, Longint, Longint):String
CurrToStr(Currency):String
DateTimeToUnix(TDateTime):TTimeStamp
EndOfFile(File):Boolean
EndOfText(TextFile):Boolean
FloatToStr(Extended):String
FilePos(File):LargeInt
FileSize(File):LargeInt
GetCurrentDir:String
GetMem(Longint):Pointer
GetProcedureAddress(Longint, String):Pointer
GetProcessID:LongWord
GetThreadID:LongWord
HexToInt(String):Longint
HexToStr(String):String
IntToBin(WholeNumber):String
IntToHex(WholeNumber):String
IntToOct(WholeNumber):String
IntToStr(WholeNumber):String
IOResult:Word
High(Constref):Longint
LastOSError:Longint
Length(Constref):Longint
LoadLibrary(String):Longint
Low(Constref):Longint
Lowercase(String):String
MatchStringArray(String, TStringArray):Longint
Max(WholeNumber, WholeNumber):WholeNumber
Min(WholeNumber, WholeNumber):WholeNumber
MinAndMax(WholeNumberArray):WholeNumberArray
Odd(WholeNumber):Boolean
Ord(Char):Byte
Paramcount:Longint
Paramstr(Longint):String
Pos(String, String):Longint
PosStringArray(String, TStringArrat):Longint
Random(Min,Max:Int64):Int64
Random(l:Int64):Int64
RandomChars(Chars:Int64):String
Random:Extended
ReadText(TextFile):String
SeekEOF(TextFile):LargeInt
StrToBool(String):Boolean
StrToBoolDef(String, Boolean):Boolean
StrToCurr(String):Currency
StrToCurrDef(String, Currency):Currency
StrToFloat(String):Extended
StrToFloatDef(String, Extended):Extended
StrToHex(String):String
StrToInt(String):Longint
StrToInt64(String):LargeInt
StrToInt64Def(String, LargeInt):LargeInt
StrToIntDef(String, Longint):Longint
StrToUInt64(String):LargeWord
StrToUInt64Def(String, LargeWord):LargeWord
StringReplace(String, String, String, TReplaceFlags):String
TimeStamp:TTimeStamp
UnixToDateTime(TTimeStamp):TDateTime
UnloadLibrary(Longint):Boolean
Upcase(Char):Char
Uppercase(String):String

Procedures

Append(TextFile)
Assert(Boolean)
Assert(Boolean, String)
AssignFile(var File, String)
AssignText(Var TextFile, String)
BlockRead(File, Var, Longint, Var Longint)
BlockWrite(File, Constref, Longint, Var Longint)
CloseFile(File)
CloseText(TextFile)
Dec(Var, Default=1)
Delete(Var String, Longint, Longint)
EraseFile(File)
EraseText(TextFile)
FillByte(Var, Longint, Byte)
FillChar(Var, Longint, Char)
FillMem(Var, Longint, Byte)
FlushFiles
FlushText(TextFile)
FreeMem(Pointer)
GetMem(Pointer, Longint)
Halt(Word)
Inc(Var, Default=1)
Insert(String, Var String, Longint, Longint)
Move(Var, Var, Longint)
RaiseException(String)
Randomize
ReallocMem(Pointer, Longint)
RenameFile(File, String)
RenameText(TextFile, String)
Reset(File, Longint)
Reset(TextFile)
Rewrite(File, Longint)
Rewrite(TextFile)
RuntimeError(Word)
SeekFile(File, Longint)
SetLength(Var, Longint)
Str(Longint, Var String)
Truncate(File)
Val(String, Var Longint, Var Word)
UniqueString(Var String)
Yield(Word)
Write(...)
Writeln(...)
WriteText(TextFile, String)