Palm DatebookDB Access with PocketC
This is software for Palm handheld organizers. The software is an add-on for 
developers working with PocketC (www.orbworks.com). Mind that this 
software is fairly useless for the 'normal' Palm user unless it is provided 
together with other software using it.
 

FILES

readme.txt - This file as pure text 
setdbeLib.prc - The library for PocketC. 
setdbeLib.lib - Used by the Desktop Environment to define the functions. 
DateDBAccess.pc - Sample PocketC application sourcecode 
DateDBAccess.pdb - Compiled sample 
 

HISTORY

0.06 07/07/2003 - bugfix, renamed all functions to lowercase
0.05 01/23/2003 - some bugfixes for PalmOS5 support. Added StartEndTime function.
0.04 04/10/2002 - Bugfix: you should be able to compile on your handheld device now, too. 
0.03 06/10/2001 - deleted getStEt! The NEW getAppt function now will return 'starttime', 'endtime', 
                                'description' and 'note'. pickDate now will return '-1' if cancle was chosen. 
0.02 05/28/2001 - Added picksT, getStEt and getNewDate. Changed getAppt. 
0.01 05/22/2001 - Added getAppt and delAppt. Change of date format. 
0.00 05/15/2001 - First release. 
 

FUNCTIONS

"setdbe.prc" will make seven functions available to PocketC: 

insertappt(int day, int starttime, int endtime, string str)
This will add an appointment to the datebookDB database at the given date 
in the format "YYYYMMDD". Starttime and endtime are integers of the format 
"HHMM" with the 2 leftmost digits represent the hour and the 2 rightmost 
digits represent the minute. If starttime & endtime are set to '-1', an untimed 
appointment is entered. 
e.g.: insertappt(20040429, -1, -1, "Happy birthday, Lars"); 
will remind you on my next birthday. 

pickdate(int day)
This opens up the Palm DatePick dialog at the given date ("YYYYMMDD"). It 
returns an integer value ("YYYYMMDD") representing the date that was picked. 
or '-1' if cancle was chosen. 
e.g.: pickdate(date(0)); 
will open the date picker on the current day. 

getappt(int date, int num, pointer int_starttime, pointer int_endtime, pointer str_description, pointer str_note)
This reads the startime, endtime, description and note of an appointment from a selected day ("YYYYMMDD") 
and a given position (num). "getappt" returns '-1' if there is no appointment. 
This function will not read repeating events! 
Mind the pointer nature of the function! The variables are declared as 'normal' integer and string variables. 
In the function call the adress is passed by means of the '&'-pointer-operator. The function will 'fill' the 
variables with the desired information. 
e.g.: 
int starttime, endtime; 
string description, note; 
(...) 
getappt(20010429, 2, &starttime, &endtime, &description, &note) 
will read the starttime, endtime, description and note of the 2nd appointment on 04/29/2001. 

delappt(int day, int num)
This will delete the n'th appointment from a given date ("YYYYMMDD"). 
"delappt" will return 1 if deltion was succesfull, 0 if not. "delappt" does 
not effect on repeating events! 
e.g.: delappt(20010429,3); 
will delete the 3rd appointment from 04/29/2001. 

pickst(int time, string title)
This will open a dialog box to pick a single time. picksT will 
return an integer with "HHMM" time format. 
e.g.: pickst(0830,"Starttime"); 
will open the time picker with time preset to "8:00" and "Starttime" as title 
description. 

getnewdate(int day, int offset)
This returns an int representing the date 'offset' days appart from the selected 
day ("YYYYMMDD"). 
e.g.: getnewdate(20040429,-365); 
will return 20030430 (2004 is a leap year!).
 

startendtime(pointer starttime, pointer endtime, string title)
This will open the timepicker dialog to enter start- and endtime
of an appointment. The values are returned through pointers.
e.g.: startendtime(&starttime, &endtime, "Select both");
will popup the timepicker and return the values picked stored 
in starttime and endtime ("HHMM" time format).
 
 

LEGAL

I provide this library free. You may do anything you wish with it 
(including using it in a commercial product), but you may not sell it. If you 
do use it in a commercial product, please give me (Lars Lewejohann) credit and 
send me a copy. My Palm username is "Lars Lewejohann", my email is 
lale@phenotyping.de
Of course, I can not be held responsible for any damage or loss 
of data on your system from using this library.
 

DOWNLOAD

This still is a beta release of the library. I highly recommend to test this on an emulator 
first. Please report bugs to lale@phenotyping.de. Or post them on the PocketC Forum

  Download setdbe.zip
 
 

Visit Tiny Red Book (A Teacher's Gradebook for Palm OS).

Visit Behavioural Phenotyping main page.

please sign my guestbook