home *** CD-ROM | disk | FTP | other *** search
/ Amiga MA Magazine 1998 #6 / amigamamagazinepolishissue1998.iso / coders / arexx / misc_arexx / oil.rexx < prev    next >
OS/2 REXX Batch file  |  1997-03-30  |  3KB  |  198 lines

  1. /*
  2.  
  3.  
  4. This program does some nice things to your shell: 
  5.  
  6. It incorporates Arexx 100% thus:
  7.  
  8.     Calulate with floats...  I use it instead of c:Eval (no floats!)
  9.     Use Variables and arrays.
  10.     Do....End loops.
  11.     Talk with programs through Shell (via Arexx port)
  12.     etc...
  13.  
  14. Can be started by itself!!
  15.  
  16.  
  17.     The program is not documented so much... Sorry...  But I thought it might
  18.     give inspiration to you...  or YOU! ;-D
  19.  
  20.  
  21.  
  22.  
  23.  
  24.  
  25.                  TUSE - The Ultimate Shell Enhancer v0.3ß
  26.  
  27.                                 Created by:
  28.  
  29.  
  30.                    Warp oh' GiGA Productions...©1995/97
  31.  
  32.                                    Alias
  33.  
  34.                               Fini A. Alring
  35.                              Højsgårds Allé 55
  36.                                2900 Hellerup
  37.                                   Denmark
  38.  
  39.  
  40.                           fini.alring@netmedia.dk
  41.  
  42.  
  43. Please send your response, on this program...
  44.  
  45. Please don't tell it doesn't support shell 100% I know! Look at Version number
  46.  
  47.  
  48. Lastup=Sun Mar 30 16:12:18 1997
  49.  
  50.  
  51. Help:
  52.  
  53.        TUSE uses some of the ASCII characters, for different tasks:
  54.  
  55.             ! - Calculus mode.  Ex.  !2+2, !2*X, !363.33-21+(X/Y) etc...  
  56.         
  57.             . - (CD) Needed to jump through Directories, and Drives...
  58.                  Use instead of CD. - Ex.  .Dh2:, .Devs/, ./, . Dh2:Games/ etc...      
  59.  
  60.             / - (Parent dir) Same as 'Cd /' or './' 
  61.  
  62.             Q or Quit = Quit TUSE.
  63.  
  64.  
  65. examples:
  66.  
  67. address 'DOPUS.1' quit
  68.  
  69. do i=1 to 10; say 'hello';end
  70.  
  71. ---
  72. a=54.55
  73.  
  74. !a*2
  75. ---
  76.  
  77.  
  78. Future improvements:
  79.  
  80. Face prompt! - :·) , :·( , :·| , :·C , ;·D , 8·Q , #8^°=
  81. ?Library access...
  82. ?fixed cd function... enables:   dh0: {enter}  and   devs {enter}.
  83.  
  84.  
  85.  
  86. */
  87.  
  88.  
  89. say center("TUSE - The Ultimate Shell Enhancer V0.3ß By Fini 'Warp' Alring / GiGA Prod'©95/97",81)
  90.  
  91.  
  92. signal on ERROR
  93. signal on SYNTAX
  94.  
  95. Address command
  96.  
  97.     options failat 21
  98.     
  99.     RC=0
  100.  
  101.  
  102. Star:
  103.  
  104.    defPATH=pragma('D')
  105.     if RC = 0 then do 
  106.         FACE=';·)' 
  107.     end
  108.     else do 
  109.         FACE=':-('
  110.     end
  111.  
  112.  
  113.    options prompt face || "·" || defPATH || "» "
  114.  
  115.  
  116.    parse pull WARG
  117.    WARGCOUNT=WORDS(WARG)
  118.     do i=0 to WARGCOUNT-1
  119.                                     XARG.i=WORD(WARG,i+1)
  120.     end
  121.    /* ^- Argument handler. */
  122.    
  123.  
  124.  
  125.  
  126.  
  127.    if upper(XARG.0)='Q' | upper(XARG.0)='QUIT' then do 
  128.                                     EXIT 
  129.     end
  130.     /* ^- Quit.  */
  131.  
  132.  
  133.    if left(WARG,1)="/" then do
  134.             WARG = Right(WARG,Length(WARG)-1)
  135.                                                  defPATH=pragma('D','/') 
  136.     Call Xend
  137.     end
  138.     /* ^- CD Parent. */
  139.  
  140.  
  141.    if left(WARG,1)="." then do
  142.             WARG = Right(WARG,Length(WARG)-1)
  143.                                                  defPATH=pragma('D',Strip(WARG)) 
  144.         Call Xend
  145.      end
  146.     /* ^- CD emul. */
  147.  
  148.    if upper(Xarg.0)="CD" then do
  149.         defPATH=pragma('D',Xarg.1) 
  150.         Call Xend
  151.      end
  152.    /* ^- CD emul. */
  153.     
  154.  
  155.    if left(WARG,1)="!" then do
  156.         WARG = Right(WARG,Length(WARG)-1)
  157.         Interpret Say WARG
  158.         call Xend
  159.     end
  160.     /* ^- Calc-mode. */
  161.  
  162.  
  163.     if left(warg,1)="," then do
  164.     /* interpret Address CADDY */
  165.       WARG = Right(WARG,Length(WARG)-1)
  166.         interpret WARG
  167.         Call Xend
  168.     end
  169.     /* ^- Arexx-mode. */
  170.  
  171.     if left(warg,1)="*" then do 
  172.          CADDY = Right(WARG,Length(WARG)-1)
  173.          interpret Address CADDY
  174.        call xend
  175.     end
  176.     /* ^- Address fixer/memorizer. */
  177.  
  178.  
  179.  
  180. /*
  181. address command WARG 
  182. */
  183. interpret WARG
  184.  
  185. /* ^- AmigaDOS-mode. */    
  186.  
  187.  
  188. Xend:
  189.  
  190. Call STAR
  191.  
  192. SYNTAX:
  193. Say 'SYNTAX!'
  194. ERROR:
  195.  
  196. Say Centre('···TUSE Error!!!···',80)
  197. Call STAR
  198. return 666