Hi Henk

I have found that if I move the 2 alerts in before the line

MemPtrFree(strSub1);

as per ( Code Sample ) below then it works.


As soon as I issue the MemPtrFree(strSub1) then strSub2 = ""


( Code Sample )


l_resultC = "- ME~0882644107";

Char *strSub1, *strSub2;

strSub1 = (Char *) MemPtrNew(StrLen(l_resultC) + 1);

if (strSub1)
{
StrCopy(strSub1, l_resultC);
strSub2 = StrChr(strSub1, '~');
if (strSub2)
{
    strSub2[0] = 0;
    strSub2++;
    // strSub1 has now the first substring, strSub2 the second, use it
    // here


    FrmCustomAlert ( 
        DebugScreenAlert , 
        "Name is", 
        strSub1, 
                NULL);

This first one has the name "- ME"

    FrmCustomAlert ( 
        DebugScreenAlert , 
        "No. is", 
        strSub2, 
                NULL);

This first one has the number "0882644107"

}
MemPtrFree(strSub1);
}

How can I get the second variable to be maintained after the MemPtrFree(strSub1)

Thank in advance.

NG


-- 
  ..-_|\      Nigel Grant
/   OZ  \   Uni. SA
\ _.--._ /   PO Box 185 Adelaide
         v    South Australia 5096

.) .)
http://geocities.com/ngrant_com

Smile its free

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

Reply via email to