home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: WPS_PM / WPS_PM.zip / of_98212.zip / OF.CMD next >
OS/2 REXX Batch file  |  1998-07-31  |  2KB  |  75 lines

  1. /*
  2.  * Pgm Name    : E:\DB\BATCH\CMD\PPWIZARD.CMD
  3.  * Pgm Version : 98.212
  4.  * Time        : Friday, 31 Jul 1998  8:45:39pm
  5.  * Input File  : E:\DB\PROJECTS\OS2\of\OF.x
  6.  * Output File : .\OUT\OF.CMD
  7.  */
  8.  
  9. PgmVersion= "98.212"
  10. Escape=d2c(27)
  11. Red=Escape|| '[0;1;31m'
  12. Reset=Escape|| '[0m'
  13. call RxFuncAdd 'SysSetObjectData', 'RexxUtil', 'SysSetObjectData'
  14. say "[]--------------------------------------------------------[]"
  15. say "| OF.CMD, Version " || PgmVersion || " (C)opyright Dennis Bareis 1998    |"
  16. say '|         http://www.ozemail.com.au/~dbareis (db0@anz.com) |'
  17. say "[]--------------------------------------------------------[]"
  18. say ""
  19. CurrentDir=directory()
  20. CmdLine=translate(arg(1))
  21. parse var CmdLine Parm1 Parm2
  22. if Parm2<> "" then
  23. do
  24. DirToOpen=Parm1
  25. ViewType=strip(Parm2)
  26. end
  27. else
  28. do
  29. if Parm1= "" then
  30. do
  31. DirToOpen=CurrentDir
  32. ViewType= "ICON"
  33. end
  34. else
  35. do
  36. if Parm1<> 'ICON' & Parm1 <> 'TREE' & Parm1 <> 'DETAILS' then
  37. do
  38. DirToOpen=Parm1
  39. ViewType= "ICON"
  40. end
  41. else
  42. do
  43. DirToOpen=CurrentDir
  44. ViewType=Parm1
  45. end
  46. end
  47. end
  48. if length(DirToOpen)=3&substr(DirToOpen,2,1)= ':' & substr(DirToOpen, 3, 1) = '\' then
  49. nop
  50. else
  51. do
  52. TryDir=DirToOpen|| '\*.*'
  53. TryDir=stream(TryDir, 'c', 'query exists')
  54. if TryDir<> '' then
  55. do
  56. TryDir=left(TryDir,length(TryDir)-4)
  57. if DirToOpen<>TryDir then
  58. do
  59. say 'Converting "' || DirToOpen || '" to "' || TryDir || '"'
  60. DirToOpen=TryDir
  61. end
  62. end
  63. end
  64. call charout,'Opening ' || ViewType || ' view of "' || DirToOpen || '"'
  65. if SysSetObjectData(DirToOpen, 'OPEN=' ||ViewType)=1 then
  66. do
  67. say ', OK'
  68. exit(0)
  69. end
  70. else
  71. do
  72. say ", " || Red || 'Failed...' ||Reset
  73. exit(219)
  74. end
  75.