Previous Step: Create a resource database.
Back to Top

# Add resources databases to your project

Pocket Smalltalk creates "executable" .prc resource databases by merging one or more existing resource databases with resources it generates containing your compiled Smalltalk code. You must therefore tell Pocket Smalltalk which resource databases to include in the final .prc file. At a minimum, you will need to include the virtual machine resource database. This can be found in the Pocket Smalltalk home directory. There are actually two virtual machine databases; the one you should use depends on whether you are planning to use double precision floating-point support:

- vm-math.prc - contains floating-point support
- vm.prc - no floating-point support

For this tutorial, you should use vm.prc, since you will not be using floating-point numbers and floating-point support requires you to install a special math library.

The way to tell Pocket Smalltalk which resource databases to include is to create a named constant for each database. Do this by opening a Constants Browser (Tools/Constants Browser from the Launcher window). Use the Constants Browser menu option Constants/Add resource database... and select the vm.prc file. A new constant named `##resourceDB1` is automatically created, and its value (shown in the bottom pane) is the filename you specified. Pocket Smalltalk will look for constants named `##resourceDB1`, `##resourceDB2`, and so forth, and it will read those files and integrate them into its final "executable" resource database.

For this tutorial, you will also need to include two other resource databases in addition to the virtual machine database you just added. These are core.prc (a database containing a few resources used by the core class library) and tut_rc.prc, which is the resource database you created in the previous page. Add these two resource databases in the same way you added the vm.prc file. You should now have three constants named `##resourceDB1`, `##resourceDB2`, and `##resourceDB3`.

Now is a good time to save your project (System/Save project in the Launcher window). This will record your work so you will not have to do it again if you leave Pocket Smalltalk and come back later.

Next Step: Create an Application class.
Back to Top