home *** CD-ROM | disk | FTP | other *** search
/ The C Users' Group Library 1994 August / wc-cdrom-cusersgrouplibrary-1994-08.iso / vol_300 / 337_01 / dir_demo.c < prev    next >
C/C++ Source or Header  |  1991-01-14  |  664b  |  30 lines

  1. /* Copyright (c) James L. Pinson 1990,1991  */
  2.  
  3. /**********************   DIR-DEMO.C   ***************************/
  4.  
  5. #include "mydef.h"
  6. #include <stddef.h>
  7.  
  8.  
  9. int start(void)
  10. {
  11. extern struct screen_structure scr;
  12. extern struct window_structure w[];
  13.  
  14. int dir_win;        /* handle for directory window */
  15. char selection[13]; /* string to receive the name of file selected */
  16.  
  17. cls();
  18.  
  19. dir_win= win_make(35,2,12,20,STD_FRAME,"",scr.normal,scr.normal);
  20.  
  21. dir("*.*",selection);
  22. win_delete(dir_win);
  23.  
  24. if (strlen(selection)==0) print (1,1, "No file selected.");
  25.  else
  26.   print(1,1,"The selected file was "); print_here(selection);
  27.  
  28. return(0);
  29. }
  30.