home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Windoware
/
WINDOWARE_1_6.iso
/
source
/
tpwpxeng
/
getdoub.pas
< prev
next >
Wrap
Pascal/Delphi Source File
|
1991-07-22
|
838b
|
35 lines
{$N+}
program GetDoub;
uses PXEngine, WinCrt;
const TableName = 'Table';
var PxErr: Integer;
TblHandle: TableHandle;
RecHandle: RecordHandle;
FldHandle: FieldHandle;
Doub: Double;
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(PXRecGet(TblHandle, RecHandle));
PX(PXFldHandle(TblHandle, 'Numeric Field', FldHandle));
(* Get a Double value from a record *)
PxErr := PXGetDoub(RecHandle, FldHandle, Doub);
if PxErr <> PxSuccess then
Writeln(PxErrMsg(PxErr))
else Writeln('Field number ', FldHandle, ' contents: ', Doub);
PX(PXRecBufClose(RecHandle));
PX(PXTblClose(TblHandle));
PX(PXExit);
end.