The Road to Delphi

Delphi – Free Pascal – Oxygene

Leave a comment

Delphi compiler magic functions and procedures

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

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.

Leave a comment

Unofficial RAD Studio 2007 Debugger Fix for Windows 7 published

An Unofficial RAD Studio 2007 Debugger Fix for Windows 7 has been published.

The primary problem being fixed is a debugger assert that usually occurs when terminating a process being debugged on a 64-bit version of Windows 7.

The text of the assert is:
Assertion failure: “(!”SetThreadContext failed”)”
This version also fixes a few minor problems when debugging on Windows 7.

you can download this patch from this site

Leave a comment

JDBC drivers for Blackfish

In StackOverflow someone ask Where can I find the JDBC driver for Blackfish?

The JDBC Drivers are located in the Blackfish SQL lib installation directory. You can download and install The Blackfish SQL 8 for Java Trial (Windows Version) wich includes the JDBC Drivers from here.

check theses files

  • jds.jar Local JDBC database connectivity
  • jdsremote.jar Remote JDBC thin client database connectivity

You can read theses articles for more info

Leave a comment

Delphi 2009, C++Builder 2009 and RAD Studio 2009 hotfix is now available

This hotfix addresses issues with debugging on Windows 7. you can found more info in this site.

This hotfix addresses issues with debugging on Windows 7, including:

  • Assertion failure: “(!SetThreadContext failed”)”
  • On Windows 7, running under the debugger can cause the debugger to crash on shutdown.
  • No Wait Chain is shown on Windows 7

Internal Tracking Number(s): QC 74732, QC 78575, 271589