Programs - ListProg


Aim

The sole reason for writing this program was to list out all my Pascal programs (I have but a few) and for each of them give a comment.

Method

Finding a way of adding a comment to each file was interesting. NDOS uses a technique of storing all the coments in a seperate file in the same directory as the program but this was too clumsy for my liking. So I decided that it should check to see whether the first line in the file was a comment and if so use that as the description. That method works very well.

The program starts by listing all the .pas files in the current directory. For each file it finds it calls a function to get the description of the program. It then stores this data in an array for later. If there is a condition define of ‘test’ the program only stores programs without descriptions. THis can be used to find the programs that need descriptions added to them.

After the program has retrived all the files they are bubble sorted, either by name or by date, to get them in the correct order to print on the screen. The listing of the programs is halted after every 24 lines so that the user can view the output without it zooming by.