home *** CD-ROM | disk | FTP | other *** search
/ Club Amiga de Montreal - CAM / CAM_CD_1.iso / files / 469.lha / ClockDJ_v5.02 / ClockRexxExamples.LZH / lad.rexx < prev    next >
OS/2 REXX Batch file  |  1991-01-05  |  3KB  |  98 lines

  1. /* Lad.rexx                                   C. Larcombe
  2.    Point-and-shoot .lzh file creator
  3.    Requires WSHell 1.02 and ARexx 1.10 both by W.S.Hawes
  4.    Requires ClockDJ 5.02 by David Jenkins
  5.    Written to use ClockDJ + CedExtendedRequester 29/12/90
  6.    Modified to use ClockDJ 5.02 or later         04/01/91
  7. */
  8.  
  9. Options results
  10. Parse arg Order
  11. Parse Source FileSource
  12. Long  = Word(FileSource , 4)
  13. Short = translate(Long , "  " , ":/")
  14. Short = word(short , words(short))
  15. If Order = '?' then call help
  16. Temp  = "Ram:$$" || short
  17. If order >'' then do
  18.   Parse var Order input ' ' lzfile
  19.   If right(lzfile,2) = '/*' then do
  20.     lzfile = left(lzfile,length(lzfile)-1))
  21.     trail = '*'
  22.     end
  23.   Else Trail = ''
  24.   Call ExecuteIt
  25.   Exit
  26. End
  27.  
  28. Dir = 'Vd0:'
  29.   Address 'CLOCKDJ'
  30.   'SETCEDTITLE'  ' SHIFT-SELECT items to add  '
  31.   'SETCEDDIRCOLOUR'    '2'
  32.   'SETCEDFILECOLOUR'   '1'
  33.   'SETCEDDEVCOLOUR'    '3'
  34.   'SETCEDLINES'       '40'
  35.   'SETCEDFILECOLS'    '24'
  36.   'SETCEDDEVCOLS'     '18'
  37.   'SETCEDBOXCOLOUR'   '3'
  38.   'SETCEDDIR'  Dir
  39.   'SETCEDFILE' ' '
  40.   'CEDEXTENDEDREQUESTER'
  41.   Input = result
  42.   If Input = "" then EXIT
  43.   if index(Input,'0a'x) = 0 then Input = overlay('*',Input,length(Input),1)
  44.   Input = Translate(Input, ' ', '0a 'x)
  45.   Segment = Word(Input,1)
  46.   Drive = Left(SEGMENT,pos(':',SEGMENT))
  47.   If (right(Input,1)='/') | (right(Input,1)=':') then,
  48.      Trail = '*'
  49.   Else Trail = ''
  50.   If Pos('/',SEGMENT) >0 then,
  51.     Dir = Left(SEGMENT,lastpos('/',SEGMENT)-1)
  52.   Else
  53.     Dir = Left(SEGMENT,pos(':',SEGMENT))
  54.   'SETCEDTITLE'  ' Select Destination File  '
  55.   'SETCEDDIRCOLOUR'    '2'
  56.   'SETCEDFILECOLOUR'   '1'
  57.   'SETCEDDEVCOLOUR'    '3'
  58.   'SETCEDLINES'       '40'
  59.   'SETCEDFILECOLS'    '24'
  60.   'SETCEDDEVCOLS'     '24'
  61.   'SETCEDBOXCOLOUR'   '1'
  62.   'SETCEDDIR'  'Vd0:'
  63.   'SETCEDFILE' ''
  64.   'CEDREQUESTER'
  65.   Lzfile = result
  66.   If Lzfile = "" then EXIT
  67.   Address
  68.   Call ExecuteIt
  69.   address clockdj
  70.   'SETCEDDIRCOLOUR'    '2'
  71.   'SETCEDFILECOLOUR'   '1'
  72.   'SETCEDDEVCOLOUR'    '2'
  73.   'SETCEDLINES'       '38'
  74.   'SETCEDFILECOLS'    '28'
  75.   'SETCEDDEVCOLS'     '14'
  76.   'SETCEDBOXCOLOUR'   '3'
  77. EXIT
  78.  
  79. ExecuteIt:
  80.   Call open Mine, Temp , w
  81.   Call Writeln mine, 'lharc -r -x a ' Lzfile Input || trail
  82.   Call WriteLn Mine, 'lharc l' lzfile
  83.   Call WriteLn mine, 'Pause "Finished: Hit a key"'
  84.   Call WriteLn mine, 'EndCLI'
  85.   Call Close Mine
  86.   'NewWsh "CON:S**/10/10/640/280/ 'short' Information Window/" from' Temp
  87.   Do while exists(Temp)
  88.     Call Delete(Temp)
  89.   end
  90. Return
  91.  
  92. Help:
  93. Say "    This Arexx macro is" Long
  94. Say "    Use "short" <file>  <dest> to LZ add a file to dest.lzh "
  95. Say "        "short" <dir>/* <dest> to LZ add a dir  to dest.lzh "
  96. Say "        "short"                for file requester."
  97. Say ""
  98. ExExe