Archive for the 'Delphi code' Category

Delphi code part 3 - Colours

Tuesday, March 6th, 2007

When I first started Delphi programming, I started with very basic stuff like number manipulation and string manipulation. This delphi unit I am going show you is a bit different, its smarter :). When I got tired of working with just numbers and strings, I started to play with colours. From the simple ones to more advanced ones.

For example, how grey colour appeared as RGB value, all the RGB values are equal. The higher the RGB value is the brighter the colour is, $FFFFFF is white, $000000 is black. I averaged two RGB values (compute R,G,B values sperately) to get an merged colour. I added values to RGB to make the colour brighter, and deducted values to make it darker.

Here is the code:

Show Code | Download colorman.pas

Delphi code part 2 - Strings

Tuesday, March 6th, 2007

Here is the part of my old delphi codes, its a unit I use frequently for string manipulation. Some are out of date, newer version of Delphi comes with better codes, same are not as smart as other units written by smart Russians, like faststrings, etc. None the less, they are useful if you like to learn the basics of Delphi or Pascal.

Show Code | Download StrMan.pas

Some useful Delphi codes part 1 - Numbers

Monday, March 5th, 2007

Over the years I have made quite a few software programs in Delphi, and inevitably I have also come up with many useful functions. Most of them I have never published on the Internet before, now I would like to list on blog.

Part 1 are functions for managing integer or real numbers, they were written very early in 1997.

Show Code | Download Numman.pas