>
> const char *LastName;
>
> Stupid question, but why would you want to use const if you plan on chaning
> the data? Because I am using multiple forms to display the data for each
> record, I have made a global person record to store the record being edited.
> I have a function that copies the field data to the record and the record
> data to the fields when the user switches forms.
Here your telling the compilar that the address where the data is stored
is constant or in other words your not dynamically allocating the memory
for LastName and thus changing the pointer. The data at the address that
LastName points to can change, the address can't.
> 1)Using the line:
> FldInsert(fpLastName,gPerson.LastName,StrLen(gPerson.LastName));
>
> I get the error:
> : In function `LoadRecordToScreen':
> :321: warning: passing arg 2 of `FldInsert' discards `const' from pointer
> target type
FldInsert is expecting a void* so the compiler has to cast off the const
but if you explicitly cast gPreson.LastName to a void* this will get
ride of the warning. As long as FldInsert is not changing the pointer
your okay.
> 2)Also when initializing a person for a new database, I use the following:
> UInt index = dmMaxRecordIndex;
> VoidHand h = DmNewRecord(gPersonDB, &index, 1);
>
> but it gives me parse error before index and then 'h' undeclared.
Make sure you include Common.h which declares VoidHand and UInt which is
most likely why you get this error. (The compilar does not know what a
UInt is.) Also, UInt and VoidHand have changed to UInt16 and MemHandle
in the 3.5 SDK.
> 3)In my Init number of persons function, for the line:
> ListPtr list = GetObjectFromActiveForm(lstPerson);
> I get the error:
> :862: warning: initialization makes pointer from integer without a cast
>
GetObjectFormActiveForm? I don't think this is defined in the API so all
undeclare protypes revert to passing back integer. Go back to the sample
files and look to see if you need to copy this function from the source
code.
--
Brian
reply to:[EMAIL PROTECTED]
backup email: [EMAIL PROTECTED]
__________________________________________________
Do You Yahoo!?
Talk to your friends online with Yahoo! Messenger.
http://im.yahoo.com
--
For information on using the Palm Developer Forums, or to unsubscribe, please see
http://www.palm.com/devzone/mailinglists.html