Thursday, 4 March 2010

Pascal Dot Plot

-->

Pascal Dot Plot

Now trying a version in Pascal (FreePascal and Lazarus).

The first task is to remind myself of Pascal, of course Pascal has changed a lot since TP 1.5 for Windows so the second task is to search for the right ways of doing some things in FreePascal.

Basics

Keep the basics the same as in the VB and CSharp versions.

Notes

Much use will be made of lists. For performance reasons these should be vectors so that frinding the n-th item is a simple indexing operation. Of course we do not know how large any of the lists must be so we must be able to extend them. The function that is needed is ReallocMem. This extends or truncates the memory block allocated to a pointer. If it cannot extend the block then it allocates a new block of the size required, copies the contents of the original block to the beginning of the new one and frees the original block. See http://www.freepascal.org/docs-html/ref/refsu197.html and http://www.delphibasics.co.uk/RTL.asp?Name=ReallocMem.

Can TStringList be used to parse the files?

No comments:

Post a Comment

Blog Archive

Followers