At 12:18 AM 7/24/2004, you wrote: static void getfielddata()
{
/* field info gasP=gasPSI, gasT=gasTEMP, gasO=gasORFICE, gasD=gasDIFFPSI, gasS=gasSCFM, gasM=gasMMBTU, gasE=gasPIPEID */
Char *gasP, *gasT, *gasO, *gasD, *gasS, *gasM, *gasE;
gasP = GetFieldText(gasPSI);
gasT = GetFieldText(gasTEMP);
gasO = GetFieldText(gasORFICE);
gasD = GetFieldText(gasDIFFPSI);
gasS = GetFieldText(gasSCFM);
gasM = GetFieldText(gasMMBTU);
gasE = GetFieldText(gasPIPEID);
}
/* Gets and returns the text in a field given the field's ID */
static Char *GetFieldText(UInt16 fieldID)
{
FormType *formPtr = FrmGetActiveForm();
UInt16 fieldIndex = FrmGetObjectIndex(formPtr, fieldID);
FieldType *fieldPtr = (FieldType *) FrmGetObjectPtr(formPtr, fieldIndex);
Char *textPtr = FldGetTextPtr(fieldPtr);
if(textPtr == NULL)
return "";
return textPtr;
}
You need to move the definition of GetFieldText() above the getfielddata() call, or add a prototype for it above that function. Since the compiler hasn't seen GetFieldText() before it's used in getfielddata(), it makes the assumption that it has the prototype "int GetFieldText(...)" and issues the warnings about turning an int into a character pointer without a cast.
-- Ben Combee, DTS technical lead, PalmSource, Inc. "Combee on Palm OS" weblog: http://palmos.combee.net/ Palm OS Dev Fourm Archives: http://news.palmos.com/read/all_forums/
-- For information on using the Palm Developer Forums, or to unsubscribe, please see http://www.palmos.com/dev/support/forums/
