P.S. Don't forget FileClose

-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] Behalf Of David Birdsall
Sent: 09 February 2006 14:07
To: Palm Developer Forum
Subject: RE: convert text/csv to pdb in unix/linux environment


You can use the par tool. The format you store your data in is up to you; with 
the par tool you can create a streamable file from your CSV or custom binary 
file:

par c -a "stream|backup|hidden|bundle" your_filename.pdb your_database_name 
DATA your_app_creator_id your_file.csv

You can then read in the file into a char array/buffer using:

FileOpen
FileTell
FileRead

It's that simple.

If your file is over 64Kb, you will either have to store in multiple buffers, 
or into storage heap using FtrPtr and DmWrite, there are documents on the 
internet to explain that. As far as I can remember, the PDB file you create 
isn't restricted in size.

File Streaming API document is here:

http://www.palmos.com/dev/support/docs/palmos/PalmOSReference/FileStreaming.html

I also suggest you look at page 202 of the Palm OS Developer's companion PDF 
for some more information

If you really want to know the format of PDB files then you can find it here:

http://www.palmos.com/dev/support/docs/fileformats/PDB+PRCFormat.html

Hope that helps you on your CSV PDB adventures.
Good luck and may the force be with you,

David

-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] Behalf Of Gnadinger,
David
Sent: 09 February 2006 13:31
To: Palm Developer Forum
Subject: Re: convert text/csv to pdb in unix/linux environment


I can convert my data to CSV, or whatever, real easy in advance of the 
conversion to a pdb file. My problem has been in determining how to format it 
for the pdb. I notice, all too often, that palm programming explanations most 
always supply the "long" answer, seldom do they provide a clear "here's how you 
do it". I've been reading everything I can get my hands on and haven't found a 
straightforward answer to this yet.

When I figure something out, I put it down in a step-by-step for later 
reference. I must be pretty alone in that area.

Thanks for the help.
-- 
For information on using the PalmSource Developer Forums, or to unsubscribe, 
please see http://www.palmos.com/dev/support/forums/

-- 
For information on using the PalmSource Developer Forums, or to unsubscribe, 
please see http://www.palmos.com/dev/support/forums/

-- 
For information on using the PalmSource Developer Forums, or to unsubscribe, 
please see http://www.palmos.com/dev/support/forums/

Reply via email to