Links
Syntax Coloring
Cream Font
Units
XML Parser
PalmOS® tools
|
PalmOS® Database import/export for Squeak 2.8 and 2.9A fileIn to enable Squeak to read, write and create PDB and PRC databases as used on
Two classes, Download
LicenseThe code is made available under the Squeak license.ExamplesThe following example code can be found in classPDB's examples category:
"You must supply real PDB and PRC files. Adjust the filenames accordingly." "Import the Memo database and examine the records. Provided you use a real MemoDB, you can see the memo's text in the Inspector by selecting a record and printing 'self data asString' in the lower pane. Note that all records end in '0 asCharacter'..." (PDB new importFromFileNamed: 'MemoDB.pdb') explore. "Import a PalmOS(R) application and examine its resources" (PDB new importFromFileNamed: 'Year.prc') explore. "Create a very simple PDB. Note the 'false' parameter to resource:..." (PDB named: 'My first PDB' type: 'HELL' creator: 'WORL' resource: false) addRecord: (PilotRecord new data: 'Hello, world.'; attributes: 0); exportToNewFileNamed: 'MyPDB.pdb'. "Reopen it and examine its contents." (PDB new importFromFileNamed: 'MyPDB.pdb') explore. "Create a very simple PRC. Do not sync that one to a real Pilot." (PDB named: 'My first PRC' type: 'HELL' creator: 'WORL' resource: true) addRecord: (PilotRecord new type: 'NONS'; id: 101; data: 'Hello, world.'); exportToNewFileNamed: 'MyPRC.prc'. "Reopen it and examine its contents." (PDB new importFromFileNamed: 'MyPRC.prc') explore. "Copy a PDB. Note that uniqueIDs will be cleared on export, as recommended by the PDB spec." (PDB new importFromFileNamed: 'MemoDB.pdb') exportToNewFileNamed: 'Copied', 'MemoDB.pdb'. "Copy a PRC. PRCs don't have uniqueIDs, so the result should be bit-identical." (PDB new importFromFileNamed: 'Year.prc') exportToNewFileNamed: 'Copied', 'Year.prc'. "Copy a PDB verbatim, preserving the uniqueIDs. Included for completeness to show bit-identicalness is possible. Remember that uniqueIDs *should* be cleared on export, as recommended by the PDB spec. Don't confuse your Pilot. ;-)" (PDB new importFromFileNamed: 'MemoDB.pdb') exportUniqueIDs: true; exportToNewFileNamed: 'VerbatimCopied', 'MemoDB.pdb' | ||||||||||||
![]() |
Copyright © 1999-2000 by Helge Horch. All rights reserved. LAST AWK RUN: hh 03oct00, contact: heho@gmx.de |