home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 11 Util / 11-Util.zip / MAKDOC.ZIP / MAKEDOC.CMD < prev    next >
OS/2 REXX Batch file  |  1993-02-14  |  2KB  |  78 lines

  1. /* MakeDoc v.1.0 by XmbSoft [CIS ID 100031,2136] */
  2.  
  3. CompStr="HSP¢"
  4. CompNum=5
  5.  
  6. call RxFuncAdd 'SysCreateObject', 'RexxUtil', 'SysCreateObject'
  7.  
  8. arg Opt Par
  9.  
  10. if Par='' then signal Format
  11. if Opt\='/D' & Opt\='/F' & Opt\='/I' then signal Format
  12.  
  13. File = strip(translate(Par,' ','"'))
  14.  
  15. FileName = FileSpec('N', File)
  16. FileDir  = FileSpec('D', File)||FileSpec('P', File)
  17. FileDir  = DelStr(FileDir, length(FileDir))
  18. Pos      = LastPos('.INF', FileName)
  19.  
  20. if Pos  = 0 then signal Bye
  21. if CharIn(File, 1, CompNum) \= CompStr then signal Bye
  22. Call Stream File, 'c', 'close'
  23.  
  24. FileName = DelStr(FileName, Pos)
  25.  
  26. Class='WPProgram'
  27. Title=FileName' Guide'
  28.  
  29. Select 
  30.    when Opt='/D' then Loc='<WP_DESKTOP>'
  31.    when Opt='/F' then Loc=FileDir
  32.    when Opt='/I' then Loc='<WP_INFO>'
  33. end
  34.  
  35. Setup='EXENAME=VIEW.EXE;'||,
  36.       'PARAMETERS='Par';'
  37.  
  38. result=SysCreateObject(Class, Title, Loc, Setup)
  39. if result\=1 then
  40. do
  41.    say 'Object not created!!! Return code='result
  42.    say
  43.    '@pause'
  44. end
  45.  
  46. Exit
  47.  
  48. Bye:
  49.    say '---- MakeDoc v.1.0 by XmbSoft [CIS ID 100031,2136] ----'
  50.    say
  51.    say
  52.    say 'The file is not a Documentation File!!!'
  53.    say
  54.    say 'Try another file (*.INF).'
  55.    say 
  56.    '@pause'
  57. Exit
  58.  
  59. Format:
  60.    say '---- MakeDoc v.1.0 by XmbSoft [CIS ID 100031,2136] ----'
  61.    say
  62.    say
  63.    say 'Syntax:'
  64.    say 
  65.    say '   MAKEDOC /x filename'
  66.    say
  67.    say 'where /x can be:'
  68.    say '      /D   Place result in the Desktop'
  69.    say '      /F   Place result in the original folder'
  70.    say '      /I   Place result in the Information folder'
  71.    say
  72.    say 'From the WorkPlace Shell, you should drag a file icon'
  73.    say 'onto the MakeDoc v.1.0 by XmbSoft icon.'
  74.    say
  75.    say
  76.    say
  77.    '@pause'
  78. Exit