$VER: runargs.doc 2.1 (31.12.2000) #AREXX © Roger Hågensen Based on work by Lord Horror Prod. Inc. & Jeff Gilpin To install this script just copy it to REXX: You also need the WBStartEmu archive to use the WB mode of this script. You can get the latest version at http://www.stephan-rupprecht.de/ If no file is marked then the program is executed with the args, if a file is marked then the program is executed with the file + the args. It is called by setting up T.H.E.'s sys:wbstartup/setKeyAndMenu like this (CLI MODE): MENU ADD NAME '"MultiView"' TITLE '"\Show\MultiView"' CMD "rexx:runargs.rexx CLI 8192 System:Utilities/MultiView SCREEN" or like this (WB MODE): MENU ADD NAME '"MultiView"' TITLE '"\Show\MultiView"' CMD "rexx:runargs.rexx WB 8192 System:Utilities/MultiView SCREEN" (WB Note) Program args must be set in the program/file icons, stack must be set in the program icon. ALL EXPLAINED.............. runargs.rexx arguments/options usage show In AmigaDOS style: runargs.rexx MODE/A,STACK/N,COMMAND/A,ARGS/F All args are *required*, and do not support STACK= etc definition since proper AmigaDOS arguments is not supported (yet) :D You can still use BLA=bla in the ARGS argument tough.... (i.e to pass on FILE=somewhere to a program etc) Or better explained: The first arg is the mode to be used, this can be CLI or WB. The second arg is the stack size, this only works with CLI tough. Due to limitations in workbench.library the wbrun command can not set the tack, however the stack set in the icon is used instead. (which is just as nice a way of doing it, since you just change the stack in the program icon instead of having to edit your stack setting in the menus :) The third arg is the path/name of the program, you MUST use full paths. The rest of the command line can be used for program spesific args. (Tough if WB mode is used the arguments is pretty much useless, put the arguments in the program icon (tooltypes) instead. If the program doesn't support that, then use CLI mode instead) Nice huh? :D Have fun! HISTORY v1.0 - First attempt. v1.1 - Some improvements! v2.0 - 30/31 December 2000 Now handles WB/CLI launch and stack & args (CLI only). (WB Note) Program args must be set in the program/file icons, stack must be set in the program icon. v2.1 - 31 December 2000 Rewrote mostly everything, should work better now! Updated the docs a little! Put everything into an archive! (nicer this way ;) FUTURE Try and find a way to handle paths with spaces. Try and support files "left out" on the WB backdrop.