Tech Note 23a: VFS Support - How to Read PDB Files

Oct 27, 2002

© NSB Corporation. All rights reserved.

Contributed by Jeffrey VanderWal

Once we know the internal structure of the "PDB" file (See Tech Note 02a), we can access it like any other file in regular Palm memory.  There are some subtle differences however.  Most of these are documented in the accompanying VFS project file "VFSEg", in the Samples folder of NS Basic/Palm 3.0.1 or later.  This is how you get started.

1.  Open the VFSEg project file.

2.  If your Palm emulator does not automatically start, start it. Make sure you are using a ROM file that supports extended memory (I will be using the Palm M505 with SD card support).

3.  Install the HostFS_Emulator (in the Tools folder).

4.  Create a directory on your hard drive where your  "simulated" you SD card/Memory stick will be.  My example will assume you are using C:\SDCard

5.  Under the directory "C:\SDCard" create a "PALM" subdirectory, and a "launcher" sub subdirectory inside the PALM directory.  You should finish with a C:\SDCard\PALM\launcher structure.  Any files you would like to show up on the memory card should be placed in this directory.

4.  Right click on the Emulator and go to settings, and then HostFS...

5..Select Slot #1, click on browse to "C:\SDCard". Click OK

6.  Check off Mount and then OK.

7.  Right click the emulator and do a soft reset.  Your SD card should show up in the App launcher as "POSESlot1" or something similar.  Your emulator is now ready to run the VFSEg project.

In NSBasic, click on F5 to run.  You may have to change the location of the shared libraries etc.  I'll leave that challenge up to you.

This project demonstrates a number of functions within the VFSLib.

Copy to Palm - with and without a dialog
Copy to Card
Version
VFSInit
Delete
Position
ReadString and more...

and more importantly, how to read the number of records and how to read strings and integers from a PDB file on the memory stick.  All documentation/code is in the file and should be self explanatory.  If you have any questions or comments, please post them on the NSBasic board for someone to take a look at.