Delphi Function Snippets


02 December, 2012   

Delphi code example for HTML color to Delphi TColor

By default, Delphi gets its date/time, currency and numeric format from Control Panel's International settings. We can set the constants defined in Delphi, like DecimalSeparator, ShortDateFormat and others like in the code below. To a complete list of these variables, look at Currency and date/time formatting variables in Delphi Help.

A short and simple code snippet using voice output with Delphi

10 March, 2012   

Example Delphi code for Copying a screen

Delphi's RTL ExpandUNCFilename function retrieves the full path and filename of a specified (relative) file using Universal Naming Convention for network files (thus making my *very old* custom function obsolete).

As the most important building block of any Delphi application, the TForm object is most of the times used as is. Delphi's TForm object provides enough properties and events to help you do (and control) whatever needed with it. Sometimes you'll find out that a few events or properties are missing... Try creating a simple form application. Now...

08 May, 2012   

Here shown an example for how to clone a Delphi Form

15 June, 2013   

Example shows here How to Clone a Delphi Form. Note: when you create a new clone from an existing form, the clone's OnCreate will not execute.

28 March, 2013   

Delphi code - Is running in terminal server

06 February, 2013   

Delphi code for Hexadecimal to Integer

In Delphi, procedural types (method pointers) allow you to treat procedures and functions as values that can be assigned to variables or passed to other procedures and functions. Here's how to call a function (or procedure) as a parameter of another function (or procedure) : Declare the function (or procedure) that will be used as a...

06 February, 2013   

Delphi code for String to Hexadecimal

25 January, 2012   

Delphi Code example how to Cut, Copy and Paste

03 December, 2013   

Delphi code to return root drive path for drive with given number.

Here's a simple trick to execute a Delphi object's method by name:

04 April, 2012   

Delphi code example for TColor to HTML color

03 December, 2013   

Delphi code to return type of drive that contains the given (full) path.

A custom Delphi function, FormatByteSize, converts a byte value into a string that represents the number expressed as a size value in bytes, kilobytes, megabytes, or gigabytes, depending on the size.

24 December, 2013   

Delphi code example to get computer MAC address

An example code for Delphi function to check drive letter to see if its valid