I don't know how you are getting the data from the field, but here's a
guess at what you need:

Char s[10];
FieldType* fldp;
FormType* frm;

CopyStr(s, "-1");
FormGetActiveForm(frm);
fldp = FrmGetObjectPointer(frm, FrmGetObjectIndex(YourFieldID));
if (FldGetTextPtr(fldp) != NULL) CopyStr(s, FldGetTextPtr(fldp));

At this point, your string contains a -1 if it was blank, or the value
entered by the user.  Store this value in the dB.

When you later display the contents of the DB, when you load the display
field test for the value (-1).  If the value is (-1) display "NA" instead
of the actual value. Something like this:
int MyValue; // MyValue is then loaded from your database before the first
line of code below
Char s[10]; // s is the string that you will display in the text field

CopyStr(s, "NA");
if (MyValue != -1) StrIToA(s,MyValue);

Now you display s in your field.

/js



In your message regarding re: How to store String value inside Int,Float &
Date dataType. dated Tue, 23 Aug 2005 12:14:56 -0000, Jeetu said that ...

>  I did not get what u actually replied to me.
>  can u just place a sample code for that plz
>  -- 
>  For information on using the PalmSource Developer Forums, or to unsubscribe,
please see http://www.palmos.com/dev/support/forums/
>  
>  
>  



-- 


-- 
For information on using the PalmSource Developer Forums, or to unsubscribe, 
please see http://www.palmos.com/dev/support/forums/

Reply via email to