home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / filedlg2.zip / FILEDLG.PLF < prev    next >
Text File  |  1995-04-20  |  1KB  |  38 lines

  1. &&GetFn.obj  BEGIN Standard File Dialog
  2. .*
  3. .*  Link prompts:                                  Examples:
  4. .*    Enter prompt in quotes: (max 32 chars)          "Specify input file:"
  5. .*    Enter file mask in quotes:                      "*.TXT"
  6. .*    Enter variable to store filename:               fn_import
  7. .*
  8. .*  Results:
  9. .*    User's selection is stored in the variable specified.
  10. .*    The global variable  getfn_ok  is set to
  11. .*       1 if user selected a filname and pressed <OK>.
  12. .*       0 otherwise
  13. .*
  14. HASH_INCLUDES %include pmstddlg;
  15.  
  16. LOCALVAR dcl getfn_title char(33) varyingz init(VARIABLE "Enter prompt in quotes: (max 32 chars)");
  17. LOCALVAR dcl getfn_filedlg FILEDLG init call plifill(addr(getfn_filedlg), '00'x, size(getfn_filedlg));
  18. LOCALVAR dcl getfn_hwnd HWND;
  19.  
  20. GLOBAL_VARIABLES dcl getfn_ok fixed bin(31);
  21.  
  22. getfn_ok = 0;
  23.  
  24. addr(getfn_filedlg)->#FILEDLG.fl         = ior(FDS_CENTER, FDS_OPEN_DIALOG);
  25. addr(getfn_filedlg)->#FILEDLG.cbSize     = size(getfn_filedlg);
  26. addr(getfn_filedlg)->#FILEDLG.pszTitle   = addr(getfn_title);
  27. addr(getfn_filedlg)->#FILEDLG.szFullFile = VARIABLE "Enter file mask in quotes:";
  28.  
  29. getfn_hwnd = WinFileDlg (HWND_DESKTOP, hwnd0, addr(getfn_filedlg));
  30.  
  31. if ( (getfn_hwnd ^= null()) &
  32.      (addr(getfn_filedlg)->#FILEDLG.lReturn = DID_OK)) then
  33. do;
  34.    VARIABLE "Enter variable to store filename:" = addr(getfn_filedlg)->#FILEDLG.szFullFile;
  35.    getfn_ok=1;
  36. end;
  37. END
  38.