home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 35 Internet / 35-Internet.zip / postroad.zip / markopen.cmd < prev    next >
OS/2 REXX Batch file  |  1997-10-23  |  3KB  |  56 lines

  1. /*          To mark all notes in a folder as having been opened           */
  2. /*                      Parameters: folder_directory                      */
  3. /*           If no parameter, current directory will be assumed           */
  4. /*    InnoVal Systems Solutions, Inc., and the authors cannot be held     */
  5. /*   responsible for damage that might occur while using this program.    */
  6. /*                         Use at your own risk.                          */
  7. call RxFuncAdd 'SysLoadFuncs', 'RexxUtil', 'SysLoadFuncs'
  8. signal on syntax name NoRexx
  9. call SysLoadFuncs
  10. signal on syntax name Syntax
  11. '@ECHO OFF'
  12. parse arg directory
  13. if pos('?',directory)>0 | directory='-h' | directory='-H' | ,
  14.    directory='/h' | directory='/H' then do
  15.    say
  16.    say 'This program marks as "opened" every note (*.POP file) in the current'
  17.    say 'or specified directory. Specify the desired folder pathname (directory)'
  18.    say 'as a command line parameter. For example, the College subfolder of your'
  19.    say 'Friends folder, in your address@wherever.com inbasket, is probably'
  20.    say 'C:\POSTROAD\ADDRESS\FRIENDS\COLLEGE, so you would type:'
  21.    say
  22.    say '   MARKOPEN C:\POSTROAD\ADDRESS\FRIENDS\COLLEGE'
  23.    say
  24.    say 'at the OS/2 command line prompt to mark every note in that folder as'
  25.    say '"opened".'
  26.    exit
  27. end
  28. if directory='' then directory=directory()
  29. if right(directory,1)='\' then directory=substr(directory,1,length(directory)-1)
  30. call sysfiletree directory'\*.POP',files,'FO'
  31. say
  32. do i=1 to files.0
  33.    drop variable
  34.    call sysgetea files.i,"POPNOTEBUFFER",variable
  35.    parse var variable one '09'x two '09'x three '09'x four '09'x five '09'x six '09'x seven '09'x attributes '09'x nine
  36.    parse var attributes ten 2 opened 3 eleven
  37.    if opened='01'x then iterate
  38.    attributes=ten||'01'x||eleven
  39.    variable=one||'09'x||two||'09'x||three||'09'x||four||'09'x||five||'09'x||six||'09'x||seven||'09'x||attributes||'09'x||nine
  40.    doneit=sysputea(files.i,"POPNOTEBUFFER",variable)
  41.    say 'Note file' files.i 'marked as "opened".'
  42. end
  43. if files.0=0 then say "No *.POP files (notes) were found in" directory "directory."
  44. else if doneit='DONEIT' then say "No unopened notes were found in" directory "directory."
  45. exit
  46. Syntax:
  47.   say 'Error' rc 'in line' sigl':' errortext(rc)
  48.   say sigl':' sourceline(sigl)
  49.   exit
  50. return
  51. NoRexx:
  52.    say 'Unable to load the REXXUtil functions.  Either the REXXUTIL.DLL file'
  53.    say 'is not on the LIBPATH or REXX support is not installed on this system.'
  54.    exit
  55. return
  56.