Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Insert a record into the file.BOOL fOK

     BOOL fOK;
int  iSession;
 

...

     fOK = LceSetFieldValue(iSession,

...

 "EMPNO",

...

 "12345");

...

     fOK = LceSetFieldValue(iSession,

...

 "SURNAME",

...

 "Buckley");

...

      
fOK = LceInsert(iSession,

...

 "EMPNO,

...

 SURNAME",

...

 "PSLMST",

...

 FALSE);

...

Psuedocode Example

     Checks if a record can be inserted.

...

     strName = "PSLMST"
strList  =

...

 "EMPNO,

...

 SURNAME"

...

      
IF NOT LceSetFieldValue(iSession,

...

 "EMPNO"

...

 ,

...

 "12345")
         / return error /
ENDIF

...

     IF NOT LceSetFieldValue(iSession,

...

 "SURNAME"

...

 ,

...

 "Buckley")
         / return error /
ENDIF

...

     IF LceInsert(iSession,

...

 strList,

...

 strName, TRUE )
         / insert the new record can be performed /
ELSE
         / cannot insert the new record /
         / display error messages /
ENDIF