since i m a newbie in palm programming..i m not so understand bout wat u 
say...But those question may hav connected to each other,for example... 

//answer YES for Q1 will link to Q2;
//answer NO for Q1 will link to Q5;

and the interface are look like:
|--------------------------|
||------------------------||  -Question is in a Field.
||    #Question here#     ||  -Therfore only the question will
||                        ||   change.
||                        ||
||                        ||
||------------------------||
|                          |
|                          |
| [Yes button] [no button] |
|                          |
|--------------------------|

i m calling this function to show the question in the field:

void setFieldText(UInt32 fIndex, Char* StrToShow)
{
    FormPtr form;
    MemHandle oldH,mH;
    
    Int16 len;
    Char* pMem;
    
    form = FrmGetActiveForm();
    fIndex = FrmGetObjectIndex(form, xfield);
    pField = FrmGetObjectPtr(form, fIndex);

        // get the field's old text handle
    oldH  = FldGetTextHandle(pField);

        //Copy our string into a memhandle

    len = StrLen(StrToShow);
    mH = MemHandleNew(len+1);
    pMem = MemHandleLock(mH);

    StrCopy(pMem, StrToShow);
        
        //The memhandle needs to be unlocked to work...
        MemHandleUnlock(mH);

        //To establish the field's link to the handle
        FldSetTextHandle(pField,mH);

        //To draw the field
        FldDrawField(pField);

        // get rid of old handle
            if (oldH != NULL)
    {
        MemHandleFree (oldH);    
    }
}
-- 
For information on using the Palm Developer Forums, or to unsubscribe, please 
see http://www.palmos.com/dev/support/forums/

Reply via email to