home *** CD-ROM | disk | FTP | other *** search
/ Power-Programmierung / CD1.mdf / pascal / library / dos / topaz / qnr / qnrdot.pas < prev    next >
Pascal/Delphi Source File  |  1991-08-07  |  2KB  |  81 lines

  1. Program QNRDot;
  2.  
  3. Uses
  4.    DBF4,
  5.    Pick,
  6.    SAYGET4,
  7.    Browse4,
  8.    VidPop,
  9.    QNR,
  10.    Crt;
  11.  
  12. Var
  13.    Done         : Boolean;
  14.    SampleQuery,
  15.    FileName     : String;
  16.  
  17. Procedure DisplayResults;
  18.  
  19. Begin
  20.    Set_BrowseWindow_To(25, 2, 79, 19, DoubleTopSingleSide + Shadow + Explode,
  21.       'Query Result');
  22.  
  23.    { Initialize the query marker }
  24.  
  25.    InitializeQuery;
  26.    If ParseQuery
  27.       Then
  28.          Begin
  29.             SET_FILTER_TO(@ProcessQuery);
  30.             GoTop;
  31.             If Not dEof
  32.                Then
  33.                   Begin
  34.                      PushWindow(25, 2, 79, 19);
  35.                      Browse('PLAIN');
  36.                      PopWindow
  37.                   End
  38.                Else
  39.                   Writeln('The query returned no valid records!');
  40.             SET_FILTER_TO(Nil)
  41.          End;
  42. End;
  43.  
  44. Begin
  45.    Writeln;
  46.    Writeln('QNRDOT - V01.00');
  47.    Writeln('(C)opyright 1991 - Caboose Software Engineering');
  48.    Writeln;
  49.    Write('USE ');
  50.    If ParamCount = 0
  51.       Then
  52.          Readln(FileName)
  53.       Else
  54.          Begin
  55.             FileName := ParamStr(1);
  56.             Writeln(FileName)
  57.          End;
  58.    If Pos('.', FileName) = 0
  59.       Then
  60.          FileName := FileName + '.DBF';
  61.    If (FileExists(FileName))
  62.       Then
  63.          Begin
  64.             Use(FileName, NIL, 0);
  65.             If (RecCount > 0)
  66.                Then
  67.                   Begin
  68.                      SampleQuery := '';
  69.                      Write('BROWSE ALL FOR ');
  70.                      Readln(SampleQuery);
  71.                      QueryString := SampleQuery;
  72.                      DisplayResults
  73.                   End
  74.                Else
  75.                   Writeln('The file selected has no records!');
  76.             Use('', NIL, 0)
  77.          End
  78.       Else
  79.          Writeln('The file does not exist!')
  80. End.
  81.