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

May 01, 2008

Copyright 2008 NS BASIC Corporation

This needs to be tested and revised for Symbian

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 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. This is how you get started.

1.  Open the VFSEg project file.

2.  Make sure your device has a memory card installed.

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

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

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 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.