home *** CD-ROM | disk | FTP | other *** search
- /* $VER: Example Script for Magic-Exchange V1.0
- Simple Magic-Exchange Test - ARexxScript
-
- © 1997 by Ingo Musquinier & Michael Einemann
-
- Syntax: rx MagicEx.rexx CDity action
- */
-
- options results
- arg Commodity action
- compress(action)
-
- if action="INACTIVE" then action="CX_Deactivate"
- if action="ACTIVE" then action="CX_Activate"
- if action="REMOVE" then action="CX_Remove"
-
-
- if open(file,'ENV:mxchg',r) then do /* read Enviroment Variable to get information */
- path=readLn(file) /* where the hell the list with CDities goes */
- close(file)
- end
-
- if ~open(file,'ENV:mxchg',r) then do
- say "Enviroment Variable for Magic-Exchange was not found!"
- exit
- end
-
- address value 'MXCHG' /* change address to MagicExchanges port */
-
- me_getcxlst /* send Command to MagigExchange to get a list of running CDities */
-
- address command wait "2 secs" /* somehow it doesn`t work without a pause */
- /* so, let this line include the script */
- address
-
- if open(cdity,''path'',r) then do /* open the list */
-
- Do i=1 until eof(cdity)
- Cdty.i=upper(readln(cdity)) /* read the list and put CDities into variables */
- if cdty.i=commodity then call manipulation /* if wanted CDity found then call label */
- else nop
- end
-
- say Commodity 'was not found in current list of Running Commodities. :-('
- end
-
- exit
-
- manipulation:
-
- address value 'MXCHG' /* change address to MagicExchanges port */
-
- me_selectcx commodity /* select the Wanted CDity */
- address command wait "2 secs" /* a little pause must be there, do not remove this line! */
- action /* make action to CDity */
-
- address /* change address e.g. to Shell for output */
-
- Say "Operation on" commodity "done."/* output this to e.g. Shell */
- exit
-
-