Pascal and Delphi Code Snippet Index

Count the words in a text string.

A function that takes a string and returns the number of words in the string. An example of using pointers in Pascal. (Read More)

Get Disk Serial Number (A classic)

ShowDriveSerialNo shows it with ShowMessage GetDriveSerialNo returns a string. You don't need both. (Read More)

Arranging strings by alphabet

This small program shows that how we can arrange strings by alphabet in a vector.By FlamingClaw (Read More)

Set Text Angle for a TFont instance

Note that the angle is in 1/10 of degrees. Any attempt to manipulate font.size or font.color will reset the angle to zero degrees. (Read More)

Number in Edit fields - check :)

Procedure which checks the number of eating properly entered in edit box with a comma (Read More)

function lowcase(s: string): string;

A simple function that converts alphabetic values into their respective lowercase value. (Read More)

Reading data from a text file into an array

Our text file contains 10 words,and located in C:\ drive,we will read this data into an array and write out the results to the screen Created by FlamingClaw 2009.04.26. (Read More)

Write one record to a file and read back

I want to show a simple example about writing record to a file,and for checking,read back from that file. Created By FlamingClaw (Read More)

Searched element's place in an array

This algorithm will add the searched element's place in an array This works only when there is so element what we're searching for. By FlamingClaw (Read More)

Searching for a number in an array

This algorithm will decide that is there a serched element in the array.If it finds one then the loop halts.If the loop halts cause we're stepping over the last element of the array then there is not searched element. By FlamingClaw (Read More)

Counts different propertied elements of an array

Counts that how many propertied elements are in the array example:negative numbers By FlamingClaw (Read More)

Add the elements of an array together

The Rule: s:=0; Loop i:=1 To N s:=s+T; End of Loop; Out:s; By FlamingClaw (Read More)

Prime or not?

Prime or not?This little program will show prime numbers with green color from 0 to 100.By FlamingClaw; (Read More)

Direct arranging of an array

This example is demonstrates a solution for direct arranging By FlamingClaw (Read More)

Operate with binary digits

I want to show you some rules about bit operating like Not,And,Or,Xor,Shl,Shr... By FlamingClaw (Read More)

Password program

This is just a simple password program... (Read More)

Skeleton of a Pascal Program

I've seen,there are guys that did not know,where to use a unit... See it just reference By FlamingClaw (Read More)

Fill an array with one string

This little program a solution for putting a string into an array. The method is that the string is divided for chars.... By FlamingClaw (Read More)

Little calculator

This little calculator can +,-,/,*.Very simple,by FlamingClaw (Read More)

Exchange two elements of an array

We change the order of elements of a vektor Created by FlamingClaw (Read More)
1

Difference between two procedure

The arguments are passed by value and by reference (Read More)

Fill an array with record

Often there is a case when we want to fill an array with record,and this program will demonstrate it... (Read More)

GoTo Statement

Many people says 'Don't use the GoTo statement,because your code will be unreadable....'.I say,can be use (Read More)

Linked List

see this simple example...very nice,and easy (Read More)

For Statement

For Statement examples,see it... (Read More)

Decimal to Binary or hex

this is one of my little program (Read More)

Is point inside polygon ?

Based on http://astronomy.swin.edu.au/~pbourke/geometry/insidepoly/ Converted to Delphi by Lord Soth (Read More)

Text file manipulation

This snippet shows how to open, read, write and close text files. This skeleton can be modified to handle any type of file, from untyped to text to typed files. (Read More)

Random Colored Pixels

This is Similar to the Previous Snippet, but it puts indivdual pixels of different colors randomly on the screen. Also makes a nice screensaver! (Read More)

Create and Read Matrix

Simple code for matrix with pascal. --Jery-- (Read More)

Guessing Game

A simple guessing game for amatuer programmers like myself. (Read More)

An improved Sleep function

The function Delay() allows access to other events during the delay. For instance a certain key could be used to interrupt a lenghty delay. The Win32 API function Sleep() ignores events, maybe it should be called DeepSleep(). (Read More)

Get the speed of your processor (CPU)

This is Delphi code, just testing if there is some interest. (Read More)

Delphi to C# Equivalances

--- Basic Datatypes --- --- Form Management --- --- Data Access --- --- Component model --- (Read More)

Restart, Shutdown, Logoff

You can use any of the commented constants to perform the explained function. You might need to adjust the process privilege on NT based OSes. (Read More)

Get MAC (Ethernet) Address of NIC

In case there are mote than one NIC (Network Interface Card) the coe gives the MAC of the first adapter. You can change the 0 on the line qoted below to take the MAC of other NICs if present. "Result := GetAdapterInfo(AdapterList.lana) " (Read More)

Disable font smoothing (Anti-aliased font)

This code disables font smoothing for a TLabel component. Can easily be converted for other VCL controls. Loren Soth (Read More)

Forum Tools


About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC