60 Reusable Code Snippet Topics

Remove Filter
Member Avatar for
Member Avatar for Dimal

Hi there! This is a simple pascal program I wrote for a cashier. Please note that this is only a basic level program code and can't actually be used for commercial use. Thanks for reading!

Member Avatar for wwwalker
0
808
Member Avatar for FlamingClaw

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.

Member Avatar for gurisa
1
3K
Member Avatar for pritaeas

This snippet shows how you can get the headers for an URL, for example to detect a redirect. I had to use the ANSI functions to ensure correctly returned headers. Manual entry for [HttpQueryInfo](http://msdn.microsoft.com/en-us/library/windows/desktop/aa385373(v=vs.85).aspx). Let me know if you have any questions/remarks.

Member Avatar for vrkiro
1
353
Member Avatar for pritaeas

The `ReplaceStrings` function replaces all strings in `APatterns` found in `ASubject` with the value in `AReplacement`. As an example, I added the `RemoveStrings` function which replaces everthing with an empty string, thus deleting all strings found. Usage examples are in the XMLDoc comments. A good test will be to rewrite …

Member Avatar for pritaeas
0
277
Member Avatar for ashine80
Member Avatar for ashine80
Member Avatar for Morten Brendefu

There are many places on internet for great help regarding many things. Proper implementation of really fast routines for sorting data however is not common. I am not claiming these routines to be the fastest around, but their ease of implementation and use may make them welcome. As a thank …

0
244
Member Avatar for FlamingClaw
Member Avatar for Morten Brendefu
0
254
Member Avatar for vegaseat

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().

Member Avatar for Duoas
0
1K
Member Avatar for Lord Soth

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

Member Avatar for hingman
1
1K
Member Avatar for TrustyTony

The code demonstrates running program limitted time by following going over endtime expressed in seconds since midnight, so might fail for playing just midnight (add check that endtime is less than 24*60*60 if you want to be sure). Exciting action :) of the program is that it shows remaining time …

0
444
Member Avatar for TrustyTony

I did this code to compare to Delphi code in Delphi forum [URL="http://www.daniweb.com/software-development/pascal-and-delphi/threads/357771"]TListBox and sorting[/URL] which ran in my computer compiled in free Lazarus environment at time 7,235 s for generate and insert to listbox, 13,265 s sorting the listbox.

0
579
Member Avatar for ReaperUser101

Hi guys The just of what i whant to do is read lines of text from a file until it reaches a delimiter and then execute that text in a query and repeat the process till there is no more text. I am using Delphi 6(don't have a choice) and …

Member Avatar for ReaperUser101
0
218
Member Avatar for FlamingClaw
Member Avatar for EAnder
Member Avatar for alenturuskovic
Member Avatar for Wolfgan
0
170
Member Avatar for Black Magic
Member Avatar for TrustyTony
0
233
Member Avatar for FlamingClaw
Member Avatar for Daaave

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.

Member Avatar for Deffcon
0
481
Member Avatar for vegaseat

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

Member Avatar for BitFarmer
0
2K
Member Avatar for FlamingClaw

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

Member Avatar for sobari
0
1K
Member Avatar for Lord Soth

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.

Member Avatar for Vector Khanal
0
237
Member Avatar for FlamingClaw

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

0
256
Member Avatar for FlamingClaw

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

0
153
Member Avatar for FlamingClaw

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

0
2K
Member Avatar for FlamingClaw

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

0
174
Member Avatar for FlamingClaw
0
800
Member Avatar for FlamingClaw

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

0
291
Member Avatar for FlamingClaw

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

0
196
Member Avatar for FlamingClaw

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

0
746

The End.