66 Reusable Code Snippet Topics
Remove Filter ![]() | |
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! | |
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. | |
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. | |
Just a few more explorations using a Python class to mimic a C Structure or Pascal Record. Loading the record from a csv type data file, displaying the data and sorting and searching the data in various ways. | |
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 … | |
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 … | |
Python does not have a type like struct in C or record in Pascal, but it can be easily implemented with a class. This little code snippet shows you how to do it. | |
This example is demonstrates a solution for direct arranging By FlamingClaw | |
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(). | |
There was question about encryption in Delphi/Pascal forum and a guy was suggested reversing the bits as additional step (I do not know if he in reality meant XOR 255, that is making 0's 1's and vice versa). As it keeps still same distribution of letters I suggested as better … | |
ShowDriveSerialNo shows it with ShowMessage GetDriveSerialNo returns a string. You don't need both. | |
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 … | |
Well, it bothers me to build menus for every shell application that needs one. So, I've written a module to handle that, like in the good old turbo pascal times. :) Here it is, the module comments are pretty explainatory, I think, and the sample usage if run as script … | |
I wrote this as reaction for Pascal newbie's question in Pascal Delphi forum. | |
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. | |
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 … | |
Using FPS IDE with FPC compiler on windows xp. | |
Procedure which checks the number of eating properly entered in edit box with a comma | |
A simple function that converts alphabetic values into their respective lowercase value. | |
The arguments are passed by value and by reference | |
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. | |
A function that takes a string and returns the number of words in the string. An example of using pointers in Pascal. | |
This small program shows that how we can arrange strings by alphabet in a vector.By FlamingClaw | |
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. | |
I want to show a simple example about writing record to a file,and for checking,read back from that file. Created By 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 | |
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 | |
Counts that how many propertied elements are in the array example:negative numbers By FlamingClaw | |
The Rule: s:=0; Loop i:=1 To N s:=s+T[i]; End of Loop; Out:s; By FlamingClaw | |
Prime or not?This little program will show prime numbers with green color from 0 to 100.By FlamingClaw; | |
I want to show you some rules about bit operating like Not,And,Or,Xor,Shl,Shr... By FlamingClaw | |
I've seen,there are guys that did not know,where to use a unit... See it just reference By FlamingClaw | |
This little program a solution for putting a string into an array. The method is that the string is divided for chars.... By FlamingClaw | |
This little calculator can +,-,/,*.Very simple,by FlamingClaw | |
We change the order of elements of a vektor Created by FlamingClaw | |
Often there is a case when we want to fill an array with record,and this program will demonstrate it... | |
| |
Many people says 'Don't use the GoTo statement,because your code will be unreadable....'.I say,can be use | |
Pascal's triangle is a geometric arrangement of the binomial coefficients in a triangle. The rows of Pascal's triangle are conventionally enumerated starting with row zero, and the numbers in odd rows are usually staggered relative to the numbers in even rows. A simple construction of the triangle proceeds in the … | |
Blink and you will see them appear in a Console window. This is a translation to C# of a Modula-2 implementation by N.Wirth, the inventor of Pascal. The tested integers are obtained by incrementing alternatively by 2 and 4, thereby avoiding multiples of 2 and 3 in the first place. … | |
| |
This program generates lines of pascal's triangle, numbers after 23 generate weird output. | |
A simple guessing game for amatuer programmers like myself. | |
Based on [url]http://astronomy.swin.edu.au/~pbourke/geometry/insidepoly/[/url] Converted to Delphi by Lord Soth |
The End.