All Delphi

Everything You Want To Know From VCL, Tips To Snippet All Everything About Delphi And CodeGear Related

Archive for the 'Tips' Category

Formatting a File Size in Bytes for Display

15th October 2008

When working with files from Delphi you might want to display the size of a file to the user in a Explorer-like format where the file size is not displayed in bytes – but the display depends on the size of the actual file.

To most users “45678123 b” is confusing – where “43.56 MB” is much more user friendly.

Format Byte Size to String

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.
Read the rest of this entry »

Posted in Snippet, Tips | No Comments »

Using Semaphores in Delphi, Part 2: The Connection Pool

30th September 2008

Too Read The Previous Article Please Read This..
Abstract: Semaphores are used to coordinate multiple threads and processes. That semaphores provide multiple threads with simultaneous access to a shared resource is highlighted by the TFixedConnectionPool class described in this article.

Semaphores are like mutexes on steroids. Not only do they provide for blocking thread synchronization, but they permit two or more threads, up to some specified maximum number, to work concurrently with a shared resource. As a result, they are unlike most other synchronization objects, which typically provide access to one thread at a time. For an introduction to the creation and use of semaphores, read the preceding article in this series on the Borland Developer Network site by clicking here. Read the rest of this entry »

Posted in Snippet, Tips | No Comments »

Using Semaphores In Delphi

14th September 2008

Abstract: Semaphores are like mutexes on steroids. Not only can they coordinate multiple threads and process, but they can permit more than one simultaneous lock. This article shows you how to use these useful objects in a multithreaded environment

Semaphores are powerful synchronization objects that, like mutexes (mutually exclusives), permit you to coordinate multiple threads and processes in your Delphi applications. Likewise, in multithreaded server environments, such as WebSnap, Web Broker ISAPI servers, and IntraWeb applications, semaphores provide a flexible mechanism for protecting shared resources.
Read the rest of this entry »

Posted in Snippet, Tips | No Comments »

How To Count Procedure Performance

23rd July 2008

Hello all delphi.com readers, Lately I got a lot of job, and the deadline was very-very tight.So I Can not post too regularly so for you all delphi.com readers I apologize, you guys have to wait, life must go on right ? :D
Ok, now I want to share a trick on how we to measure the performance of one procedure or one syntax.
Read the rest of this entry »

Posted in Tips | 5 Comments »

How To Make DBGrid Autosize

14th July 2008

Hi all delphi readers, have you all confront with this situation, imagine you have created some nice application with superb GUI (Graphical User Interface) but then when you do the final testing and review you find out that. Data that has longger length compare to DBGrid field length was castrate..that was very – very annoying. yeah ..I also think so i know this feeling because I’ve been there.. :D Read the rest of this entry »

Posted in Snippet, Tips | No Comments »

How To Coloring DBGRID Row

12th July 2008

hi all delphi readers, You’ve seen this surely on web pages. Alternating table row colors means displaying the first record in one color and the second record in another color and continue to alternate the color of each row displayed. Read the rest of this entry »

Posted in Snippet, Tips | No Comments »

How to Embeded files inside Exe(2)

2nd July 2008

Including (Linking/Embeding) Resources to Executables

With the Borland’s Resource Compiler we have created the AboutDelphi.res resource file. The next step is to add the following compiler directive to a unit in your project, immediately after the form directive (below the implementation key word). Read the rest of this entry »

Posted in Tips | No Comments »

How to Embeded files inside Exe(1)

2nd July 2008

hi all delphi readers, Games and other types of applications which use multimedia files like sounds and animations must either distribute the extra multimedia files along with the application or embed the files within the executable.
Rather than distribute separate files for your application’s use, you can add the raw data to your application as a resource. You can then retrieve the data from your application when it is needed. This technique is generally more desirable because it can keep others from manipulating those add-in files. Read the rest of this entry »

Posted in Tips | No Comments »

How to sent file to recycle bin in delphi

30th June 2008

hi all delphi reader, today i want to share how to delete or sent files to recycle bin so after deletetion we can retrieve again the file.

Here’s a Delphi procedure that can delete a file with the ability to undo by sending the file to the “Recycle Bin. “Function bFileDelete” will return True if the operation was successful. Read the rest of this entry »

Posted in Snippet, Tips | No Comments »

How To Create A Roll Up Form (with animation)

28th June 2008

hello, alldelphi.com reader todays tips is .. how to create a roll up form with animation. sure we now there are several component that can do that trick such as billenium and also one of the JEDI component. But surely if we can do it our self why buy or used another component right ? Read the rest of this entry »

Posted in Snippet, Tips | No Comments »