Comments on 2'nd REXX program requested 
Author Message
 Comments on 2'nd REXX program requested


I found that the method I used in the past to learn programming, namely
looking at other peoples code, does not seem to work with REXX.  I have
found very little other code to view.  I am hoping that you will look at
this effort and make suggestions on how to improve it.

This program was intended to work only under OS/2 2.x REXX.  
I call it TODAY.  I use it to list all of the files I have created during
the day, so that I can erase all of the many temporary files I seem to make
while working.

/* Checks for files with todays date                                         */
/* If found they are displayed                                               */
/* Note option '/s' to turn off subdirectory search                          */

/* Jim Tremain, 3 March 1993                                                 */

rc = RXFUNCQUERY(SysFileTree)   /* 0 if function available, 1 if unavailable */
IF rc = 1 THEN DO
   SAY 'Error, RxUtil function SysFileTree unavailable.  Today halted!'

PARSE ARG Directory '/' Option           /* get the Directory to be checked  */

   WHEN option = 'S' THEN Option = 'B'     /* DO not search subdirectories   */
   WHEN option = 's' THEN Option = 'B'
   WHEN option = ''  THEN Option = 'S'     /* search subdirectories          */
      SAY 'Syntax error!  Use TODAY path /s, where s stops subdirectory search'

Directory = STRIP(Directory)
IF Directory='' THEN Directory='*'

CALL SysFileTree Directory, 'file', Option          /* 32 bit memory is nice */
IF rc='2' THEN DO
   SAY 'Not enough memory.  TODAY halted!!'
else DO
/* CMD.EXE Does not seem to notice the country setting in config.sys         */
   ToDay = DATE('U')                                 /* USA style = mm/dd/yy */
/* STRIP leading 0 as it is not in the dates retrieved by SysFileTree        */
   today = STRIP(today,'L','0')                  
   DateNormal = DATE('N')
   SAY 'Files created today,' DateNormal'.'
   DO i=1 to file.0
      IF (WORDPOS(today, file.i) > 0) THEN DO
/* just in case someone has a directory that looks like a date make sure     */
/* this checks only the date area                                            */
         IF (WORDPOS(today, file.i) <3) THEN SAY file.i
   SAY 'Done.'

Thanks for your comments

Mon, 21 Aug 1995 00:52:20 GMT  
 [ 1 post ] 

 Relevant Pages 

1. Request for comments/opinions on FPGA programming

2. TCL POLL: 2'nd day

3. TCL POLL: 2'nd edition

4. Stopping A REXX Program With Another REXX Program

5. sharing external functions between cms rexx programs and xedit rexx programs

6. Request for McCabe's complexity program

7. Calling another rexx program won't work...

8. Request for comments

9. Request for Comments

10. Requesting Comments on OOP code

11. urgent request for comments on a string replacement method


Powered by phpBB® Forum Software