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

  1. program RecLock;
  2. uses PXEngine;
  3.  
  4. const TableName = 'Table';
  5.       NetDir    = '';
  6.       NetType    = NotOnNet ;
  7.  
  8. var   PxErr: Integer;
  9.       TblHandle: TableHandle;
  10.       RecHandle: RecordHandle;
  11.       LckHandle: LockHandle;
  12.  
  13. begin
  14.   PX(PXNetInit(NetDir, NetType, DefUserName));
  15.   PX(PXTblOpen(TableName, TblHandle, 0, False));
  16.   PX(PXRecBufOpen(TblHandle, RecHandle));
  17.  
  18.   (* Attempt to lock current record *)
  19.   PxErr := PXNetRecLock(TblHandle, LckHandle);
  20.   if PxErr <> PxSuccess then
  21.     Writeln(PxErrMsg(PxErr))
  22.   else PX(PXNetRecUnlock(TblHandle, LckHandle));
  23.  
  24.   PX(PXRecBufClose(RecHandle));
  25.   PX(PXTblClose(TblHandle));
  26.   PX(PXExit);
  27. end.
  28.