home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Power-Programmierung
/
CD1.mdf
/
pascal
/
library
/
windows
/
pdoxeng
/
srchkey.pas
< prev
next >
Wrap
Pascal/Delphi Source File
|
1994-04-11
|
940b
|
39 lines
program SrchKey;
uses PXEngine, WinCrt;
const TableName = 'Table';
Search = 'SearchString';
var PxErr: Integer;
TblHandle: TableHandle;
RecHandle: RecordHandle;
FldHandle: FieldHandle;
NFlds: Word;
procedure PX(Code : integer);
begin
writeln(PXErrMsg(Code));
end;
begin
PX(PXWinInit('MyApp', pxShared));
NFlds := 1;
PX(PXTblOpen(TableName, TblHandle, 0, False));
PX(PXRecBufOpen(TblHandle, RecHandle));
PX(PXFldHandle(TblHandle, 'Alpha Field', FldHandle));
PX(PXPutAlpha(RecHandle, FldHandle, Search));
(* Search for match on a key *)
PxErr := PXSrchKey(TblHandle, RecHandle, NFlds, SearchFirst);
if PxErr <> PxSuccess then
if PxErr = PxErr_RecNotFound then
Writeln('No match found')
else Writeln(PxErrMsg(PxErr))
else Writeln('Match found');
PX(PXRecBufClose(RecHandle));
PX(PXTblClose(TblHandle));
PX(PXExit);
end.