This section presents you with some short Object Pascal code examples for Delphi. I will try to add some new ones from time to time. Feel free to send me your remarks or tips about these pages and the other Delphi-related content you can find here. All code examples open in a new window.
How can I check whether a string contains a valid IP address (IPv4)?
How can I retrieve the default DNS server address?
How can I create a hidden application?
How do I obtain the screen resolution and colour depth?
How to copy a file and show the windows progress dialog?
How to show the Windows select folder dialog and return the name of the selected folder?
How to invoke the Windows Format Drive dialog?
How to find out what version of Windows is running?
Note: When you are looking for a very useful and comprehensive discussion about date and time related material, in both in general and specifically targeted to Delphi, you should absolutely visit the website of Dr. John Stockton (link opens in a new window). He offers heaps of interesting stuff. He is also a valued member of the Delphi Newsgroups. Also, on the Delphi resources page, you will find links to other very useful resources.
How do I check in which quarter a given date belongs?
How can I find the first day of the quarter for a given date?
How can I find the last day of the quarter for a given date?
How can I find the last day of the month for a given date?
How can I find out how many days there are in the month for a given date?
How can I find out if a given year is a leap year?
How can I subtract minutes from a given time?
This page was last updated 19 June 2005.