home *** CD-ROM | disk | FTP | other *** search
/ Club Amiga de Montreal - CAM / CAM_CD_1.iso / files / 339.lha / FReq / FReq.rexx < prev    next >
OS/2 REXX Batch file  |  1990-02-07  |  2KB  |  73 lines

  1. /* FReq.rexx  -  This Program tests all the FileRequester's commands */
  2.  
  3. if ~(Show('P', 'FileRequester')) then    /* Is FReq resident in memory ? */
  4.     do    /* if not RUN it */
  5.     ADDRESS COMMAND "Run >NIL: <NIL: DEVS:FReq >NIL: <NIL:"
  6.     ADDRESS COMMAND "C:WaitForPort FileRequester"
  7.     if ~(Show('P', 'FileRequester')) then
  8.         do
  9.         say "UnAble to Load FileRequester"
  10.         exit
  11.         end
  12.     end
  13.  
  14. OPTIONS RESULTS
  15.  
  16. ADDRESS "FileRequester"
  17.  
  18. 'GETFILENAME'    /* This is the Easiest way to Call FReq */
  19. if (RC = 0) then
  20.     say 'Returned Filename - ' Result
  21. else
  22.     say 'No FileReturned'
  23.  
  24.  
  25.  
  26. /* Let's Ask for another name */
  27.  
  28. 'DisplayDef'        /* Tells FReq to use the Default Settings */
  29. 'SetPattern' '#?c#?'    /* Sets the Default Pattern Specification */
  30. 'SetPath' 'SYS:C'    /* Sets the Default Path */
  31. 'SetFileName' 'NoName'    /* Sets the Default File Name */
  32. 'SetTitle' 'This is REXX test NUMber 2'
  33. 'GETFILENAME'        /* Ask FReq to return a File Name */
  34. select
  35.     when RC = 0 then
  36.         say 'Returned Filename - ' Result  /* returned a File Name */
  37.     when RC = 1 then
  38.         say '<<CANCEL>>'    /* User hit the Cancel Gadget */
  39.     when RC = 2 then
  40.         say '<<CLOSED>>'    /* User closed down FReq */
  41.     otherwise
  42.         say 'UnKnown Return from FReq'
  43.     end
  44.  
  45. /* Let's Ask for another name */
  46.  
  47. 'DisplayDef'
  48. 'SetPath' 'SYS:'
  49. 'SetPattern'    /* Clear the Pattern */
  50. 'SetFileName'    /* Clear the File Name */
  51. 'SetTitle' 'Info Files Should be Listed'
  52. 'DisplayInfo ON'    /* Tell FReq to display the .info files */
  53. 'GETFILENAME'
  54. if (RC = 0) then
  55.     say 'Returned Filename - ' Result
  56. else
  57.     say 'No FileReturned'
  58.  
  59.  
  60. /* Let's Ask for another name */
  61.  
  62. 'DisplayDef'
  63. 'SetTitle No Info Files this Time'
  64. 'DisplayInfo off'
  65. 'GETFILENAME'
  66. if (RC = 0) then
  67.     say 'Returned Filename - ' Result
  68. else
  69.     say 'No FileReturned'
  70.  
  71.  
  72. 'CloseDown'  /* Get FReq out of Memory */
  73.