Have you localized the problem to the GetValue function? The problem could
be in the UnpackValue code. Are you allocating memory for the CharPtr in
the program that calls GetValue? These are just guesses, without more code,
I can't suggest much more.
Regards,
Steve
-----Original Message-----
From: Timothy Astle [mailto:[EMAIL PROTECTED]]
Sent: Thursday, April 13, 2000 10:08 AM
To: Palm Developer Forum
Subject: Re: Simple example needed
This is something I tried so that I could just Get a value from the database
so that I could display it.
theValue.BeginningValue is a floating point number.
UniqueID is just the record's ID tag
CharPtr GetValue(UInt UniqueID)
{
tblValue theValue;
VoidHand valueHandle = DmGetRecord(gValueDB, UniqueID);
UnpackValue(&theValue, MemHandleLock(valueHandle));
MemHandleUnlock(valueHandle);
return ((CharPtr)&theValue.BeginningValue);
}
What I'm using to display the information is:
SetFieldTextFromStr(NfoStartofValueValueField, GetValue(1));
Where it takes the CharPtr and places it in the Field.
It compiles, etc, but when I run it, I get a DataManager error. My best
guess is that it has to do with the way I'm attempting to get the value from
the database... I dunno. I figure I'm probably going about this all the
wrong way, but if someone could please help, I'd appreciate it.
--
Timothy Astle
Timothy Astle <[EMAIL PROTECTED]> wrote in message
news:8137@palm-dev-forum...
>
> I have 3 databases set up, and 6 structures (packed and unpacked
versions).
> I also have packing and unpacking funcitons set up.
>
> I was wondering if anyone had a "stripped down" piece of code that allowed
> me to simply ADD and DELETE records.
>
> Any small example would be great, because I could take it from there and
> expand upon it.
>
> Sincerely,
>
> Timothy Astle
>
>
>
>
--
For information on using the Palm Developer Forums, or to unsubscribe,
please see http://www.palm.com/devzone/mailinglists.html
--
For information on using the Palm Developer Forums, or to unsubscribe, please see
http://www.palm.com/devzone/mailinglists.html