home *** CD-ROM | disk | FTP | other *** search
/ Programmer 7500 / MAX_PROGRAMMERS.iso / PASCAL / MPICKE.ZIP / MPICKER.PAS < prev    next >
Encoding:
Pascal/Delphi Source File  |  1988-08-23  |  1.2 KB  |  42 lines

  1. Program menupicker;
  2. (*********************************************************************)
  3. (*  PROGRAM MENUPICKER                                               *)
  4. (*********************************************************************)
  5. (*  Public domain routines for anyone's free use                     *)
  6. (*  BY:  Frank H Carr         August 16, 1988                        *)
  7. (*       Compuserve           71121,3247                             *)
  8. (*       Gene Plantz IBBS     (312) 885-2303   ID0434                *)
  9. (*********************************************************************)
  10.  
  11. USES
  12.   dos,crt,picker;
  13.  
  14. VAR
  15.   pickmenu:menu;
  16.   numfiles,choice:byte;
  17.   dirinfo:searchrec;
  18.  
  19. BEGIN
  20.  clrscr;
  21.  numfiles:=0;
  22.  findfirst('*.*',archive,dirinfo);
  23.  while doserror = 0 do
  24.    begin
  25.      inc(numfiles);
  26.      pickmenu[numfiles]:=' '+dirinfo.name+' ';
  27.      findnext(dirinfo);
  28.    end;
  29.  if numfiles > 0 then
  30.    begin
  31.      gotoxy(1,20);
  32.      write('Choose a file...');
  33.      choice:=achoice(pickmenu,10,5,numfiles,5,1,1);
  34.      writeln;
  35.      if choice > 0 then
  36.        writeln('You picked:',pickmenu[choice])
  37.      else
  38.        writeln('You pressed <Esc>');
  39.    end
  40.  else
  41.    writeln('Some IO error occurred');
  42. END.