Merlin's Cavern
Bill Catambay, Pascal Programmer



Updated: 3-4-03


Source for Mac OS Classic

Below are some complete Pascal projects, including source code, resources, project file and running application. This source code is provided as-is, free of charge. If you have short questions about any of this code, you may e-mail the author, but please do not expect a tutorial on how to program.

This code is provided for you to learn how to perform functions in Pascal. You may not copy this code and use it in any commercial or shareware products without permission from the author.

NOTE: There is now a Belorussian translation available thanks to Bohdan Zograf!

Recent archives are now compressed using the new StuffIt 5.0 format.
You will need
StuffIt Expander 5.0 (or better) to decompress them.

Download Author TidBits
OGL Hovertank
Shows how to use OpenGL camera, and some 3D movement transformations. Also shows some basic vehicle effects such as acceleration, inertia, and friction. Includes project file, executable and source (requires OpenGL libraries).
Christian Franz
3-4-03
- OpenGL calls
- OpenGL camera
- OpenGL 3D movements
- Vehicle effects
Mole Sample
This sample code project demonstrates a lot of different things, from playing Midi and MP3 files, to asynchronous sounds, to connecting to servers and launching web browsers. The project includes all the source code, project file, and executable. Run the executable and take the Pascal challenge!
Bill Catambay
12-19-02
- Plays midi from resource
- Plays MP3 from files
- Asynchronous sounds
- Server connections
- Launch web browser
- Card graphics & shuffling
- Multi-pane windows
- Event driven
- Window Manager
TE Sample
This TextEdit package originated from Apple in 1989, and has been revised for better readability as well as updates to work with UI 3.4. Includes source code, project file, and simple TextEdit application.
Bill Catambay
10-31-01
- Text Edit Manager
- Event driven
- Window Manager
MP3 Demo
This package contains some useful MP3 units, and a demo program that opens an MP3 file and displays properties. Includes source code, project files, and applications.
Johan Vindevogel
10-24-00
- Open file types
- MP3 units
- Display MP3 data
Battle Sea
This page describes the game Battle Sea, a game similar to the board game Battleship, and provides the Pascal source code, a project file and a running application.
Matteo Varisco
10-10-01
- Board Game
- Event driven
- Windows & Dialogs
- Game graphics
- Game AI
GetASCII
Two sample projects to query the keyboard, both for key codes and for ASCII codes. Includes source and project files, as well as useful utility applications.
Bill Catambay
10-3-01
- GetKeys
- ASCII conversion
DeskTop Watch
Sample project to draw a live watch that displays the time, with preferences, min/max, and other features.
Bill Catambay
10-3-01
- Events
- Window resizing
- Window moving
- Preferences
- Asynchronous Sound
Approximate Pi
Program which approximates Pi in effort to demonstrate Extended80 (for 68k) as well as other functions.
Bill Catambay
10-3-01
- Extended80
- GetIntlResourceTable
- BlockMove
- StringToFormatRec
- extendedToString
HideMenuBar
Program which completely hides the menubar, and animates a bouncing ball in an area overlapping the menubar region.
Bill Catambay
10-3-01
- Hides Menu Bar
- Animation wrapping
- Asynchronous Sound
- Trigonometric paths
- Internet Config
- Live Web and Email links
Coin RAEL
This is a CodeWarrior Pro 4 project showing how to create a game in Pascal using the Carbon environment (it works with MacOS 9.0.4, 9.1 and 10.0.4). Includes source code, project file, and classic OS 9 executable.
Matteo Varisco
9-26-01
- Board Game
- Event drive
- Windows & Dialogs
- Multiple Undos
- Offscreen drawing
- Game graphics
IC ClickURL CDEF
This CDEF resource allows you to effortlessly add live URLs to the alerts and dialogs in your application. It uses Internet Config (IC) and recognizes all the URLs that IC recognizes (http:, ftp:, mailto:, etc.). Includes source code, IC API, project file and compiled CDEF.
Philippe Casgrain
9-26-01
- CDEF
- Internet Config
- Launch URL
Fading Balls
Yet another SillyBalls sample application, but this one adds new features for offscreen double-buffered animation, vertical retrace synchronization, and pixmap fading. It includes project file, source code and CW Pro 6 and THINK Pascal 4.5 project files.
Jean-Yves Bernier
3-28-01
- Offscreen
double-buffering
animation
- Vertical retrace
synchronization
- Pixmap fading
Weston Pascal Framework
This is a Pascal version of the C++ framework developed in the book Elements of C++ Macintosh Programming. It shows all the elements of a Mac OOP framework and could be developed a lot further.
Paul Rodman
3-9-01
- Object-oriented
- Framework
- Windows
- Quicktime
- AppleEvents
Arrow Draw Demo
This demo illustrates how to draw arrow heads, including indented arrows and arrows as varying angles. It includes Arrow unit, Pascal project, and running sample program.
Philippe Casgrain
11-3-00
- Arrow drawing
- Dialog action
- AppleEvents
Labels Printing
This program is designed to print labels with text, counters, and bar codes on any type of standard labels.
Robert R. Dell
10-30-00
- Barcode labels
- Label Printing
- AppleEvents
Button Action
This package includes source from DialogPlus and PopUpFinder, and provides projects for 68k and PPC.
Bill Catambay
4-13-00
- Dialog action
- Dialog filters (UPPs)
- Apple Events
- Opening Folders
Generic LDEF Demo
This demo application shows how to create your own LDEF resource and use it within your program. The package includes THINK and CW projects, source code, applications and a great How-To document.
Johan Vindevogel
4-6-00
- LDEF resource
- List Manager
- Dialogs
ExcelCells
Demonstrates how to transfer data back and forth between your program and another running application using AppleEvents. Includes source code and sample program, and updated to support CodeWarrior and THINK.
Kevin Killion
3-29-00
- AppleEvents
- InterApplication Communications
- Excel Handshaking
Normal Curve Demo
This program demonstrates how to calculate the area under a normal curve with mean of 0 and sd of 1, for any given sd. It also has a function for calculating the area under a curve using Simpsons Rule.
James Derrick
2-29-00
- Normal curves
- Calculating area
- Simpson's rule
- Sioux functions
PopUp Sampler
An older sample of using the Dialog Manager, with buttons, submenus, popup menus and more. Includes a CW Pro 4 project file that works with Universal Interfaces 3.2.
Bill Catambay
2-22-00
- Dialogs
- Popup Menus
- Hide and disable controls
ErrorHandler
A set of routines for handling error, including sample applications, CW and THINK project files and source code.
James Phillips
1-25-00
- Error handling
- Dialogs
HeartBeat
An application that pushes a string of characters out through the Modem port. This action can be monitored in different ways, and indicates that the machine is operating correctly.
Paul B Jones
1-25-00
- Serial port
- Modem access
- Process manager
GetQuote
A very simple program for retrieving a stock quote via the web, and parsing the results for output. It includes PPC-only project, source code, and running application.
Bill Catambay
12-13-99
- Stock quote parsing
- HTTP Data retrieval
- URL Access
- Sioux I/O
Malachi
A complete HTML parser, with source code, project file, running application and sample HTML file.
Arnout Symoens
11-22-99
- HTML Parser
- Sioux
- File I/O
FastSocketServerSioux
FastSocketServer is an example TCP/IP program that includes a FastSocketServer unit, an AifTCP unit, and several TCP interfaces written by Peter Lewis.
Arnout Symoens
11-2-99
- Client/Server
- TCP/IP
- Event driven
- Sioux
OSA Script
A small sample project demonstrating how to pass arguments into a script, and retrieving the arguments upon script execution (includes source, sample script and running application).
Jan Skarbek
10-21-99
- Script execution
- Script arguments
QT MidiBox Demo
An excellent demo package for using Quicktime libraries to play midi sound tracks. Includes source code, project file, running application and sample Midi's.
Johan Vindevogel
10-11-99
- Quicktime code
- Quicktime windows
- Plays QT movies
- Plays flat midi's
- Folder scans
- Folder tricks
- Event driven
WASTE-P 1.1.4 Demo
This is the complete WASTE package all in Pascal. It has been updated for CW Pro Pascal, includes WASTE library and library project files, and includes a WASTE Demo application with associated source code and project file.
Bill Catambay (CW Pro Port)
9-22-99
(original author: Marco Piovanelli)
- WASTE Text Utilities
- Full Text Editing
- Event driven
- Fonts & Styles
- File I/O
- Drag & Drop
UUEncoder
This package provides very simple functions for UUEncoding and UUDecoding files. It includes a sample program, with source code and project, which UUEncodes a file.
Paul Rodman &
Bill Catambay

9-22-99
- UUEncode
- UUDecode
- File I/O
E-mail Senders
This package includes project, source code and sample application for using Applescript to send e-mail from within your application using either Eudora or Claris E-mailer.
Ranko Bojanic
9-9-99
- Shell program
- Controls
- Applescript
- E-mail sender
FBA Sampler
Demonstrates how Faceless Background Applications (FBAs) work. The sample plays sounds at random intervals until receiving a quit event. Comes with projects for the FBA and for a program to stop the FBA process, including source code and executables.
Bill Catambay
9-7-99
- FBA
- Asynchronous sound
- Apple Events
Appearance Manager Sample
This project includes some REW Appearance Manager routines, a CW Pro 4 project, and a small sample program (source and executable) illustrating the Mac OS Appearance Manager.
Bill Catambay & Bob Williams
8-19-99
- Appearance Manager
- Simple Alerts
Audio CD
This project demonstrates how to read the track times off of an Audio CD. It includes project file, source code, resource file and running applications.
Johan Vindevogel
7-15-99
- Reads Audio CD
track times
- Event driven
- Menus, Lists and Dialogs
Request Video v1.2
This is a port of Apple sample code for the Display Manager, now updated to work with CW Pro 2 and higher.
Ingemar Ragnemalm
6-28-99
- Display manager
- Video settings control
DEMON Help
Program which uses list manager to display a list of subjects, and inserts text into a scrolling text window based upon which subject is clicked on.
Bill Catambay
6-28-99
- Events
- List manager
- Pane resizing
- Animated icons
- Text utilities
TE Sample
This is the Text Sample program provided by Apple Computer, complete with FAT project, code, and executable.
Apple Computer
6-28-99
- Text utilities
- Events
JCW Preferences
Includes a unit and example program in CodeWarrior Pro 4 Pascal that allows users to create and use preferences files with ease.
Jesse C. Wood
6-10-99
- Preferences updating
- File I/O
Killer Apps
Two projects which demonstrate how to shutdown processes (includes source, projects and executables). One project does a shutdown on all processes, and the other is for just restarting the Finder.
Bill Catambay
6-4-99
- Sending AppleEvents
- Process Shutdown
- Finder Restarting
CScript
A small library that allows you to execute AppleScript code from directly inside your application (now supports PPC and CodeWarrior).
Sebastiano Pilla & Bill Catambay
6-1-99
- Applescript execution
- Dialogs
Apple Zoomer
This is a sample screen saver using the SAT libraries, animating Apple logos in a "starfield" fashion.
Ingemar Ragnemalm
5-28-99
- SAT Library sample
- Screen saver
- Events
- Graphics
MP HelloWorld
This sample program demonstrates the use of the Multi-Processor API (and includes the Pascal version of the API).
Ingemar Ragnemalm &
Matt Mora

5-26-99
- Multi Processors API
- Multi Processors example
SavePict
A unit which demonstrates how to convert a drawing into a PICT file. Includes a sample program, project and running application.
Bill Catambay
5-21-99
- Saving pict files
- Converting to PICT format
- Resource handling

Archives above this point are compressed using the new StuffIt 5.0 format.
You will need
StuffIt Expander 5.0 (or better).

AHProgress
AHProgress is a unit for drawing progress bars, and is unique in that it offers 3 types of bars: color, pattern and picture.
Anthony Hubble
3-16-99
- Standard progress bar
- Patterned progress bar
- Picture progress bar
Setup Assistant
The Assistant is built around a skeleton application taken from Inside Mac (Toolbox Essentials and Advance Toolbox). It includes a launcher to show how to launch an assistant
programmatically.
Johannes Jander
1-22-99
- Creating a Setup Assistant
- Appearance manager
- Launcher
- Preferences
- Handlers
- Program shell
Make QT Movie
This sample program generates and saves QuickTime movies, providing a dialog for selecting formats.
Steve Martin
1-22-99
- QT movie generation
- QuickTime movie formats
- Dialogs
EMR Installer
The complete source code package to the applications for creating the EMR Installer (a patch which upgrades Marathon Infinity to Excalibur).
Charles Lechasseur
12-23-98
- Installer code
- Resource manipulation
- Resource encoding
- Progress bars
- Dialogs
- Spinning cursors
Advanced Graphics
A set of demo applications which use various techniques for graphics drawing, collision, and sprite animation.
Arnout Symoens
12-1-98
- Graphics
- Offscreen worlds
- Sprite animation
- Sprite collision
- Encoded sprite drawing
Ask for URL
This tidbit demonstrates the use of sending an Apple Event to either Netscape or Explorer and retrieving the current URL.
Kevin C. Killion
11-24-98
- Apple Events
- Browser communications
- URL processing
- Dialogs
Chisel Effects
This is an Effects Kit which can be used to create effects in Chisel, the Marathon Infinity map editing tool written by Kirill Levchenko.
Mike Trinder
11-10-98
- Creating plug-ins
- Dialogs
- Events
- File I/O
Replace Resource
The ReplaceResource module with demo. ReplaceResource is a great resource creation and modification routine (this version is in CodeWarrior and Think).
David Blache
11-3-98
- Resource creating
- Resource replacing
- Dialogs
OSAX Shell
Shows how to write a simple scripting addition with multiple osaxen in CodeWarrior. The project is a single-segment, extended code resource.
David Blache
10-29-98
- Scripting Addition
- Code Resource
LabMouse
Source code to an unfinished first-person 3D game. You can use the game engine to make simple 3D mazes. It is even possible to make a shooter like Wolf3D with it.
Ingemar Ragnemalm
9-8-98
- 3D Mazes
- Event handling
- Game engine
- Pixel doubling
- Score keeping
- Scalable sprites
- 3D Wall texturing
Turtle Graf
A graphics demo program which demonstrates turtlegraphics and bit-mapped graphics creation and display. This style of programming is very useful in writing games.
Robert Dell
8-5-98
- Turtle graphics
- Bitmap graphics
- Event handling
TextToSTR
This sample program reads through a tabular text file and converts all of the lines into separate STR# resources (starting with ID 128) and all of the columns within a line to parts of the STR# resource.
A. D. Jensen
8-5-98
- Text to STR conversion
- Resource handling
FakeAlert
A unit which creates a dialog without using a resource file. Includes a sample program which uses the unit (code, project file and running application).
Ingemar Ragnemalm &
Bill Catambay
7-13-98
- Resourceless dialog
SendFax Demo
An article about the FAXstf library, including sample source code for sending Faxes in Pascal.
Ranko Bojanic
5-26-98
- Fax sending
- Printing
- Event handling
- Custom dialogs
Jordan's Gone!
A game written in THINK Pascal using the THINK Class Library 1.1.2 (TCL) and Ingemar Ragnemalm’s Sprite Animation Toolkit (SAT). This package has the complete THINK Pascal Project for Jordan’s Gone!, along with the classes built to interface TCL to SAT, and to streamline TCL for games. The programmer documentation gives the essentials of construction.
Patrick C Hew
4-27-98
- Game code
- Think Class Library
- SAT
- Object Oriented
Text Rotation
A demo program that rotates text counterclockwise in one degree increments. Color, size, style, and font can be adjusted. The result has a pixel and a vector presentation and is put into the clipboard and shown on the screen as well.
Peter Hoerster
4-23-98
- Pixmap rotation
- Offscreen pixmap access
- Using PicComments
- Code resource pop-ups
- Offscreen technics
- FKey code
CopyBits Demo
A program which demonstrates just about everything you would ever want to do with CopyBits (converted from a C program by Kenneth Worley).
Bill Catambay
3-4-98
- CopyBits
- CopyMask
- CopyDeepMask
- Picture Fading
- Picture Sliding
- Depixelizing
- Blurring
Scrolling Windows
A collection of two Pascal projects, one which demonstrates how to create working scrollbars and the other demonstrates how to apply this to a scrolling window that contains a picture.
Mark Pazolli
3-4-98
- Window scrolling
- Picture scrolling
Moon Phase
A simple talking program which calculates the moon phase given a date.
Bill Catambay
3-4-98
- Moon phase calculations
- Integer to Hex function
- Speech Manager
Star Field
A simple Pascal implementation of a star field, including a 68K and PPC version.
Bob Williams
3-4-98
- Star field graphics
- FPS calculations
Sliders PLUS
Four units and a demo program for icon handling and gray sliders.
Matthias Wuttke
3-4-98
- Icon caching
- Icon buttons
- Offscreen utils
- Gray sliders
PICTButton Demo
A source code project for a button CDEF, and source code project for sample program using the CDEF.
Jeremy Ferrett
3-4-98
- CDEF project
- Dialog buttons
- Event handling
- Object Pascal
- Speech manager
REWPassword Unit
Unit and sample program for processing password input.
Bob Williams
3-4-98
- Dialog input
- Hidden text
- Text processing
- Object Pascal
Indexed Strings
Unit and sample program for accessing indexed strings in STR# resources.
Louis Bellotto
3-4-98
- Resource I/O
CornerClock v1.8
Utility which displays the time or date in the menu bar to the left of the Apple menu, and plays an hourly chime asynchronously (unlike the system chime, it locks the handle to prevent a corrupted chime).
Bill Catambay
3-4-98
- Writes in Menu Bar
- Saves Preferences
- AppleEvents
- Asynchronous Sound
- Dialog input
- Event handling
DropBin v1.5
Utility which encodes a binhex file. Either drop a file on this application, or open a file from within this app, and it will binhex the file.
Bill Catambay
3-4-98
- AppleEvents
- Progress bar
- CRC Calculating
- Binhex encoding
- File I/O
- Event handling
- Dialogs
Gamma Fade
Program performs a gamma fade on the screen.
Matt Mora
3-4-98
- Gamma fading utilities
ModalProgress
Written in Object Pascal, this program illustrates progress bar routines which accompany the package. It includes three sample progress dialogs, one for textual representation of the percent complete, one for growing to the right as the task progresses, and one for an infinite progress bar.
Bill Catambay
3-4-98
- Progress bars
- Object Pascal
- Event handling
- Dialogs
CampFireDemo
Based upon a C program, this is the Pascal version of a program which produces an animated flame by drawing some simple random colors at the bottom of the image and then simply averaging the colors of every pixel in the image.
Ingemar Ragnemalm
3-4-98
- Palette manipulation
- Color animation
- FPS calculations
Balloon Dissembler
A tool for taking menus and dialogs out of an application into a text file for use with Balloon Help Compiler.
Milton Aupperle
3-4-98
- Dialog handling
- File I/O
- Resource manipulation
ColorCheck
A program which demonstrates prompting the user to switch to 256 colors (if not already there), performing some animation, then switching back.
Bill Catambay
3-4-98
- Dialogs
- Color switching
MP Dialogs
The Multipane Dialogs library provides an easy-to-use set of functions for creating pane dialogs. Originally written in C, this package provides a Pascal version of the sample code for utilizing the Multipane Dialogs.
Koryn Grant
3-4-98
- Advanced preferences
- Multiple panes
- Dialogs
- Event handling
My Type 0.3
Utility that will print a catalog of all the installed fonts on your Mac.
Steve Huey
3-4-98
- Preferences
- Scrolling About box
- List handling
- Printing
- Event handling
Pascal Depth
Program which displays a dialog allowing selection of color modes.
Bill Catambay
3-4-98
- Dialogs
- Color mode changing
SimpleDrag
Program implementing drag and drop of text and pictures from one window to another. Originally written in C, converted to Pascal by Matt Mora. I fixed some bugs and ported it to CodeWarrior.
Bill Catambay
3-4-98
- Drag and Drop
- Event handling
SimpleViewer 3D
A program for viewing a QD3D model with standard functionality for rotating. Converted to Pascal from the QD3D C sample code.
Bill Catambay
3-4-98
- QD3D
- AppleEvents
- Drag and Drop
- Event handling
- Dialogs
Text to Strings
This is a drag-and-drop application that disassembles any text file
dropped on it to Str255's (without using AppleEvents).
Ingemar Ragnemalm
3-4-98
- Text to String


This page authored by Bill Catambay
Comments to: Pascal Central Editor