home *** CD-ROM | disk | FTP | other *** search
/ Programmer 7500 / MAX_PROGRAMMERS.iso / INFO / TURBOPAS / TUR6_102.ZIP / STAYDEM.340 < prev    next >
Encoding:
Text File  |  1986-02-22  |  3.4 KB  |  88 lines

  1. var
  2.   Trash        : char;
  3.   attribyte,
  4.   OldAttribute : byte;
  5.   Xcursor      : integer ;
  6.   Ycursor      : integer ;
  7.  
  8. begin
  9.  
  10.       filename := '*.*' ;
  11.       attribyte := 255 ;
  12.       OldAttribute := attribyte;
  13.  
  14.               Xcursor := 2 ;
  15.               Ycursor := 1 ;
  16.               GotoXy(Xcursor,Ycursor) ;
  17.  
  18.           Find_First(attribyte,filename,Retcode);
  19.               If Retcode = 0 then
  20.                  begin
  21.                  write(Filename);
  22.                  Ycursor := Ycursor +1 ;
  23.                  end;
  24.           {Now we repeat Find_Next until an error occurs }
  25.  
  26.               repeat
  27.                 Find_Next(attribyte,filename,Retcode);
  28.                 if Retcode = 0 then
  29.                  begin
  30.                         GotoXY(Xcursor,Ycursor);
  31.                         Write(filename) ;
  32.                         Ycursor := Ycursor + 1 ;
  33.  
  34.                         if WhereY >= 14 then
  35.                         begin
  36.                         Xcursor := Xcursor + 16 ;
  37.                         Ycursor := 1 ;
  38.                         end;
  39.  
  40.                         if (Xcursor >= 50) and (Ycursor = 13 ) then
  41.                         begin
  42.                         Ycursor := Ycursor + 1;
  43.                         GotoXY(Xcursor,Ycursor);
  44.  
  45.                         Get_Abs_Cursor(x,y);    { Box up More msg..}
  46.                         MkWin(x,y,x+10,y+1,Cyan,black,0); Gotoxy(1,1);
  47.                         Write (' More...');
  48.  
  49.                         While (Not Keypressed);
  50.                         Read(Kbd,trash) ;
  51.                         RmWin;                  { Remove "More" window }
  52.  
  53.                         clrscr ;
  54.                         Xcursor := 2 ;
  55.                         Ycursor := 1 ;
  56.                         end;
  57.                  end;
  58.                until Retcode <> 0;
  59.                                        { Make a little Window and hold for }
  60.                                        { user to give us a goose..or whatever}
  61.                GotoXY(Xcursor,Ycursor);
  62.                Get_Abs_Cursor(x,y);        { Get Absolute Cursor Position  }
  63.                MkWin(x,y,x+16,y+1,Cyan,Black,0);   { Put Window at Cursor   }
  64.                GotoXY(1,1);
  65.                Write('Press a key ...');
  66.  
  67.                While (Not Keypressed);     { Pause until Key pressed }
  68.                While Keypressed do         { Get Ctrl-Home maybe     }
  69.                Read(Kbd,KeyChr);           { Read the users Key      }
  70.                RmWin ;                     { Remove the Window       }
  71.                If KeyChr = Quit_Key then   { If Terminate Key then   }
  72.                            Stay_Xit ;      { remove ourself from  Memory }
  73. end;
  74.  
  75. {----------------------------------------------------------------------}
  76. {        D   E  M  O                                                   }
  77. {----------------------------------------------------------------------}
  78. Procedure Demo ;                   { Give Demonstration of Code        }
  79.  
  80.   begin
  81.        KeyChr := #0;               { Clear any residual krap    }
  82.        MkWin(5,5,75,20,Bright+Cyan,Black,3); { Make a Biiiiiiig window}
  83.        Clrscr;                     { Clear screen out           }
  84.        Get_file;                   { Show directory entries     }
  85.        RmWin;                      { Remove the big window      }
  86.   end; { Demo }
  87.  
  88.