« Return to Thread: Datebook /ToDo databases

RE: Datebook /ToDo databases

by Morten Agerlin Petersen (MAP) :: Rate this Message:

Reply to Author | View in Thread

Hello Ricardo

Perhaps this could be a start?
It is a quick and dirty Plua 2.0 program that tries to list the contents
of various Palm databases.
But I don't know the structure of the databases so it is trial and
error!

The program tries to read 12 "fields" of each record in the database and
list it as 12 lines on the screen. Using the KeyDown lists the next
records 12 lines.

There is no way of stopping except going through the whole database!

------------------------------------------------------------------------
--------------------
--List database.lua
screen.clear()
gui.destroy()

db="ToDoDB"
--db="DatebookDB"
--db="ExpenseDB"
--db="AddressDB"
--db="MemoDB"

 
f,n = io.open("db:/"..db,"r")
for i = 0,n-1,1 do
screen.clear()
f:openrec( i)    
s = f:read( "*a")  
if s~=nil then
d = bin.unpack('BSBBBBBBBBBSB', s)
for j = 1,12,1 do  io.write("#",j,": ",d[j]," \n ") end

while gui.event()~=keyDown do end
end
end  
f:close()
------------------------------------------------------------------------
--------------------

-----Original Message-----
From: plua@... [mailto:plua@...] On Behalf Of
Ricardo
Sent: 6. april 2009 21:32
To: plua@...
Subject: [plua] Datebook /ToDo databases

Hello,

I'd like to write an application for a Palm TX that reads the Datebook
(Calendar?) or ToDo database, selects the records from a particular
category (for instance, all records from the category Deadlines), and
prints them on the screen, together with the number of days up to every
particular event (i.e. 36 days left to writing the paper, 72 days left
to studying for the maths exam, etc.). Do you think this would be easy
to do in Plua (I've never done any Palm OS programming).

I've seen that there are some database I/O functions, but I'm not sure
how they can be used to read (and write) Datebook and Todo records on
the native PIM databases. Is there a source code example with an example
of this (reading/writing from/to native databases).

Thanks!  



------------------------------------

Yahoo! Groups Links



 « Return to Thread: Datebook /ToDo databases