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

  1. program GetLong;
  2. uses PXEngine;
  3.  
  4. const TableName = 'Table';
  5.  
  6. var   PxErr: Integer;
  7.       TblHandle: TableHandle;
  8.       RecHandle: RecordHandle;
  9.       FldHandle: FieldHandle;
  10.       LValue: LongInt;
  11.  
  12. begin
  13.   PX(PXInit);
  14.   PX(PXTblOpen(TableName, TblHandle, 0, False));
  15.   PX(PXRecBufOpen(TblHandle, RecHandle));
  16.   PX(PXRecGet(TblHandle, RecHandle));
  17.   PX(PXFldHandle(TblHandle, 'Numeric Field', FldHandle));
  18.  
  19.   (* Get a double value from a record *)
  20.   PxErr := PXGetLong(RecHandle, FldHandle, LValue);
  21.   if PxErr <> PxSuccess then
  22.     Writeln(PxErrMsg(PxErr))
  23.   else Writeln('Field number ', FldHandle, ' contents: ', LValue);
  24.  
  25.   PX(PXRecBufClose(RecHandle));
  26.   PX(PXTblClose(TblHandle));
  27.   PX(PXExit);
  28. end.
  29.