The first compiler I ever bought was Borland Turbo Pascal 1.0 (http://community.borland.com/museum), which I continued to upgrade and use on a daily basis for my programming work through version 7. Turbo Pascal was a wonderful product, it had a nice editor with lots of shortcut keys, was amazingly fast, was great at catching source errors (like all Pascal compilers) and included good debugging support. I really cut my programming teeth on Pascal, and I still look back with fond memories.
But back to my little utility. I needed an OS/2 version that supported longer paths. I remembered I had come across Virtual Pascal 2.1 (http://www.vpascal.com) a few weeks ago, a free, full-blown Pascal compiler for OS/2, Windows and Linux. I decided to install it and see what it would do with my old Borland Pascal source code.
Once I got over my surprise, SETUPOS2.EXE worked like a charm and installed Virtual Pascal for me. It also includes options to import various libraries (Object Windows Library, Visual Class Library, Object Professional) from other Pascal's if you have them installed on your computer.
One thing I discovered as soon as I tried to build a project is that you need to go and have Virtual Pascal build its runtime library before you can compile anything else. To do this, open an OS/2 window, change to the VP21\SRC\RTL directory and run BUILDRTL.CMD with OS2 as the parameter. If you plan to build Windows or Linux apps, you'll have to do this for those targets as well.
Editing files is fast and easy if you remember all your WordStar shortcuts like ^QF for find, ^QR for top of document etc. The IDE also supports modern GUI editing features such as mouse marking. I had forgotten how quick and easy all those keyboard shortcuts made text editing once you learned them.
Of course it didn't work quite right. A big drive back when the utility was written was 500M. It got a little confused when the total size of all the files went over 2G and with a drive size also over 2G. To fix this problem I adjusted all the file size counters to use doubles rather than longints. I also had to adjust the formatting as the original 10 digit number format I had selected wasn't quite wide enough.
Running the resulting app results in the following screen for a moment:
then a long list of directories followed by a summary like:
All the numbers are accurate except Disk Size and Unaccounted which use VP's DiskSize function which unfortunately tops out at 2G. If anyone knows how to get the right number back, I'd like to hear it. Waste Space is calculated based on the cluster size, so if you aren't running HPFS, that number will be incorrect as well. Free Space is good until the amount of free space on the drive goes over 2G. Hmmm, that number seems to keep popping up. If you compare the output to DIR, you will notice that the number of files doesn't match. This is because DIR counts . and .. where DIRSIZEOS2 doesn't.
Virtual Pascal used to be a commercial product, only the most recent version is freeware, so it is quite feature-complete and a spectacular bargain. If you haven't tried programming before, Pascal is certainly a good place to start since it offers lots of power while being a lot more forgiving than C and not nearly as complex as Java has become.
If you want to use DIRSIZEOS2.EXE (dirsizeos2.exe) on your
own computer, go ahead and give it a try. Drop me a note if you like it.
This article is courtesy of www.os2ezine.com. You can view it online at http://www.os2ezine.com/20010816/page_7.html.