From: Mark M. <mie...@gm...> - 2010-07-31 15:54:26
|
On Sat, Jul 31, 2010 at 7:20 AM, Peter Anderson <pet...@gm...> wrote: > It is my weekend for having problems with ooRexx. > > I have installed ooRexx on my backup PC (laptop) and checked that > ooRexx is associated with *.rex files and that rexx.exe is in the path > system variable. ooRexx scripts will run from the DOS prompt and now > from within my text editor (EditPlus) but if I try to double click a > script from Windows Explorer there is a momentary flash of a window > (the DOS prompt window I think - its just too fast) and nothing > happens. > > Is it possible to configure Windows so that double clicking an ooRexx > script makes it run. In Windows the act of double-clicking on an icon to run a program is intended to launch graphical programs. Rexx scripts are (for the most part) intended to be from from a command prompt. When you double-click on an icon representing an ooRexx script, the operating system opens up a command prompt window to executed the program and then closes it when the program ends. That is what Windows is designed to do. So, when you double click on your script, Windows opens a console window, the script executes, and Windows closes the console window. Your script does run. There are a number of things you can do, but really, why not just run your programs from a console window? 1.) At the end of your program put in a pull statement, that will allow you to see the program. Like this: /* Simple.rex */ x = 2 n = 55 msg = '2 to the 55th is' do i = 1 to n x = x + x end say msg x pull then double click on it to see the output 2.) You could use ooDialog to write graphical Rexx programs, then double-clicking on the program works the way the operating system intends double-clicking to work. 3.) You can associate the Rexx scripts that you want to work by double-clicking with rexxpaws.exe which comes with ooRexx. Like the following. Please note that you have to use the path to where your rexx.exe is actually installed. My rexx.exe is in C:\Rexx\ooRexx C:\Rexx>assoc .rex .rex=REXXScript C:\Rexx>ftype REXXScript REXXScript="C:\Rexx\ooRexx\rexx.exe" "%1" %* C:\Rexx>ftype REXXScript="C:\Rexx\ooRexx\rexxpaws.exe" "%1" %* REXXScript="C:\Rexx\ooRexx\rexxpaws.exe" "%1" %* C:\Rexx> A variation of that would be to use a different extension and only associate that extension with rexxpaws. Then use that extension for programs you want to double-click and keep .rex for programs you run from the command line. (The proper way. <grin>) Something like the following. The first command is to put the fytpe back to what it was before I changed to rexxpaws above. C:\Rexx>ftype REXXScript="C:\Rexx\ooRexx\rexx.exe" "%1" %* REXXScript="C:\Rexx\ooRexx\rexx.exe" "%1" %* C:\Rexx>ftype REXXScript REXXScript="C:\Rexx\ooRexx\rexx.exe" "%1" %* Now create an association for .rxdc and set that ftype to execute with rexxpaws. C:\Rexx>assoc .rxdc=RexxDoubleClick .rxdc=RexxDoubleClick C:\Rexx>ftype RexxDoubleClick="C:\Rexx\ooRexx\rexx.exe" "%1" %* RexxDoubleClick="C:\Rexx\ooRexx\rexx.exe" "%1" %* C:\Rexx> Now double-clicking on Simple.rxdc will work. /* Simple.rxdc */ x = 2 n = 55 msg = '2 to the 55th is' do i = 1 to n x = x + x end say msg x -- Mark Miesfeld |