program GotoLock;
uses PXEngine, WinCrt;

const TableName = 'Table';

var   PxErr: Integer;
      TblHandle: TableHandle;
      RecHandle: RecordHandle;
      LckHandle: Integer;

procedure PX(Code : integer);
begin
  writeln(PXErrMsg(Code));
end;

begin
  PX(PXWinInit('MyApp', pxShared));
  PX(PXTblOpen(TableName, TblHandle, 0, False));
  PX(PXRecBufOpen(TblHandle, RecHandle));
  PX(PXNetRecLock(TblHandle, LckHandle));

  (* Go to record previously locked *)
  PxErr := PXNetRecGotoLock(TblHandle, LckHandle);
  if PxErr <> PxSuccess then
    Writeln(PxErrMsg(PxErr));

  PX(PXNetRecUnlock(TblHandle, LckHandle));
  PX(PXRecBufClose(RecHandle));
  PX(PXTblClose(TblHandle));
  PX(PXExit);
end.
