home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 5 / 05.iso / a / a006 / 1.ddi / PASEXAM.ZIP / PUTSHORT.PAS < prev    next >
Encoding:
Pascal/Delphi Source File  |  1991-03-11  |  691 b   |  30 lines

  1. program PutShort;
  2. uses PXEngine;
  3.  
  4. const TableName = 'Table';
  5.  
  6. var   PxErr: Integer;
  7.       TblHandle: TableHandle;
  8.       RecHandle: RecordHandle;
  9.       FldHandle: FieldHandle;
  10.       SValue: Integer;
  11.  
  12. begin
  13.   SValue := 321;
  14.  
  15.   PX(PXInit);
  16.   PX(PXTblOpen(TableName, TblHandle, 0, False));
  17.   PX(PXRecBufOpen(TblHandle, RecHandle));
  18.   PX(PXFldHandle(TblHandle, 'Short Field', FldHandle));
  19.  
  20.   (* Update record with short value *)
  21.   PxErr := PXPutShort(RecHandle, FldHandle, SValue);
  22.   if PxErr <> PxSuccess then
  23.     Writeln(PxErrMsg(PxErr))
  24.   else PX(PXRecUpdate(TblHandle,RecHandle));
  25.  
  26.   PX(PXRecBufClose(RecHandle));
  27.   PX(PXTblClose(TblHandle));
  28.   PX(PXExit);
  29. end.
  30.