The Road to Delphi

Delphi – Free Pascal – Oxygene

Delphi compiler magic functions and procedures

Leave a comment

If you look in System.pas, you won’t find a High() or Low()  function that is declared anything like what you would expect.  These functions and procedures are called compiler “magic” functions.

This list enumerate the intrinsic routines exposed by the System unit. These intrinsic routines are actually handled by the compiler rather then the run-time library.

Original list http://docwiki.embarcadero.com/RADStudio/en/Delphi_Intrinsic_Routines

System.Abs Returns an absolute value.
System.Addr Returns a pointer to a specified object.
System.Append Prepares an existing file for adding text to the end.
System.Assert Tests whether a Boolean expression is true.
System.Assigned Tests for a nil (unassigned) pointer or procedural variable.
System.Assign Associates the name of an external file with a file variable.
System.AssignFile Associates the name of an external file with a file variable.
System.BlockRead Reads one or more records from an open file into a variable.
System.BlockWrite Writes one or more records from a variable to an open file.
System.Break Causes the flow of control to exit a for, while, or repeat statement.
System.Chr Returns the character for a specified ASCII value.
System.Close Terminates the association between a file variable and an external file.
System.CloseFile Terminates the association between file variable and an external disk file.
System.Concat Concatenates two or more strings into one.
System.Continue Allows the flow of control to proceed to the next iteration of for, while, or repeat statements.
System.Copy Returns a substring of a string or a segment of a dynamic array.
System.Dec Decrements a variable by 1 or N.
System.Default Returns the default value for generic type.
System.Delete Removes a substring from a string.
System.Dispose Releases memory allocated for a dynamic variable.
System.Eof Tests whether the file position is at the end of a file.
System.Eoln Tests whether the file pointer is at the end of a line.
System.Erase Deletes an external file.
System.Exclude Removes an element from a Delphi set.
System.Exit Exits from the current procedure.
System.FilePos Returns the current file position.
System.FileSize Returns the number of records in a file.
System.FillChar Fills contiguous bytes with a specified value.
System.Finalize Uninitializes a dynamically allocated variable.
System.Flush Empties the buffer of a text file opened for output.
System.FreeMem FreeMem frees a memory block.
System.GetMem GetMem allocates a memory block.
System.Halt Initiates abnormal termination of a program.
System.Hi Returns the high-order byte of X as an unsigned value.
System.High Returns the highest value in the range of an argument.
System.Inc Increments an ordinal value by one or N.
System.Include Adds an element to a Delphi set.
System.Initialize Initializes a dynamically allocated variable.
System.Insert Inserts a substring into a string beginning at a specified point.
System.Length Returns the number of characters in a string or elements in an array.
System.Lo Returns the low order Byte of argument X.
System.Low Returns the lowest value in a range.
System.New Creates a new dynamic variable and sets P to point to it.
System.Odd Returns true if argument is an odd number.
System.Pi Returns 3.1415926535897932385.
System.Pred Returns the predecessor of the argument.
System.Ptr Converts a specified address to a pointer.
System.Read Read reads data from a file.
System.ReadLn Reads a line of text from a file.
System.ReallocMem ReallocMem reallocates a memory block.
System.Rename Changes the name of an external file.
System.Reset Opens an existing file.
System.Rewrite Creates a new file and opens it.
System.Round Returns the value of X rounded to the nearest whole number.
System.RunError Stops execution and generates a runtime error.
System.Seek Moves the current position of a file to a specified component.
System.SeekEof Returns the end-of-file status of a file, ignoring whitespace.
System.SeekEoln Returns the end-of-line status of a file, ignoring whitespace.
System.SetLength Sets the length of a string or dynamic-array variable.
System.SetString Sets the contents and length of the given string.
System.SizeOf Returns the number of bytes occupied by a variable or type.
System.Slice Returns a sub-section of an array.
System.Sqr Returns the square of a number.
System.Str Formats a string and returns it to a variable.
System.Succ Returns the successor of an argument.
System.Swap Exchanges high order byte with the low order byte of an integer or word.
System.Trunc Truncates a real number to an integer.
System.TypeHandle Returns the RTTI information for a given type.
System.TypeInfo Returns the RTTI information for a given type.
System.TypeOf Deprecated routine.
System.Val Converts a string to a numeric representation.
System.VarCast Converts a variant to specified type.
System.VarCopy Copies a Variant to another Variant.
System.Write Writes to either a typed file or a text file
System.WriteLn Writes to a text file and adds an end-of-line marker.

Author: Rodrigo

Just another Delphi guy.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s