program FldBlank;
uses PXEngine, WinCrt, WinTypes;

const TableName = 'Table';

var   PxErr: Integer;
      TblHandle: TableHandle;
      RecHandle: RecordHandle;
      FldHandle: FieldHandle;
      Blank: Bool;

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

begin
  FldHandle := 1;

  PX(PXWinInit('MyApp', pxShared));
  PX(PXTblOpen(TableName, TblHandle, 0, False));
  PX(PXRecBufOpen(TblHandle, RecHandle));
  PX(PXRecGet(TblHandle, RecHandle));

  (* See if the field is blank *)
  PxErr := PXFldBlank(RecHandle, FldHandle, Blank);
  if PxErr <> PxSuccess then
    Writeln(PxErrMsg(PxErr))
  else if Blank then
         Writeln('Field is blank')
       else Writeln('Field is not blank');

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