6 30 1 C Example

LANSA Open Guide

6.30.1 C Example

BOOL fOK;

int  iSession;

wchar_t *pwstrSurname;

long lFlags;

long lDataLen;

 

fOK = LceGetFieldDataLength(iSession, "SURNAMEU", &lDataLen);

lDataLen = ( (lDataLen + 1) * sizeof(wchar_t) );

pwstrSurname = malloc(lDataLen);

fOK = LceGetFieldValueU(iSession, "SURNAME", pwstrSurname, lDataLen, &lFlags);

 

if (lFlags == 1)

{

    realloc(pStrSurname, 21);

    strcpy(pStrSurname, "Surname Not Provided");

}