program RecLocked;
uses PXEngine, WinCrt, winTypes;

const TableName = 'Table';

var   PxErr: Integer;
      TblHandle: TableHandle;
      Locked: Bool;

procedure PX(Code : integer);
begin
  writeln(PXErrMsg(Code));
end;

begin
  PX(PXWinInit('MyApp', pxShared));
  PX(PXTblOpen(TableName, TblHandle, 0, False));

  (* See if record is locked *)
  PxErr := PXNetRecLocked(TblHandle, Locked);
  if PxErr <> PxSuccess then
    Writeln(PxErrMsg(PxErr))
  else Writeln('Record Locked: ', Locked);

  PX(PXTblClose(TblHandle));
  PX(PXExit);
end.
