jayg
Freshman Member
Posts: 9
|
Post by jayg on Jan 2, 2019 17:01:20 GMT -5
I currently use a command in my exec invoking SPFLITE to open a file
address cmd "C:\Program Files\SPFLite\SPFLite.exe" file1
Currently the exec will open the file and pause until I close it. Is there a parameter that would allow the exec to continue processing while I review file1? Simply put I need to open 2 files at once for comparison. Thanks
|
|
|
Post by George on Jan 2, 2019 17:44:52 GMT -5
jayg:
Well, first I would go to Options => General and set SPFLite to "Only 1 SPFLite running".
Then, make sure you start SPFLite asynchronously, so your ooRexx doesn't wait for it to terminate.
Next, start the 2nd file the same way. With the "Only 1 SPFLite running" set, the 2nd SPFLite invocation will simply "pass off" the file to the 1st running instance and it should open in a new tab.
This is, of course, what "should" work. Let me know how you do.
George
|
|
jayg
Freshman Member
Posts: 9
|
Post by jayg on Jan 2, 2019 18:44:11 GMT -5
Thanks George but only works if I have an spflite window open, otherwise when I click on my rex program icon it only opens one file at a time.
|
|
|
Post by nicc on Jan 2, 2019 19:16:06 GMT -5
Googled "how to start a .exe in background from .bat" You need to START the task so change your rexx to: address cmd 'start spflite' file1 as your command. SPFLite will then start as a background task. Presumably, doing "spflite file2" will bring the background task to the foreground with both files open.
Refer to the 'dos' START command (help start at a command line)
|
|
jayg
Freshman Member
Posts: 9
|
Post by jayg on Jan 2, 2019 20:14:28 GMT -5
Pardon my ignorance, I have SPFLITE in C:Program Files if I invoke cmd "address cmd 'start spflite' file1", I get an error that windows can't find Spflite. If I try to invoke with the full path name C:\Program Files\SPFLite\SPFLite.exe it doesn't recognize the space between Program and Files' Is there somewhere I can define or authorize SPFLITE where the system recognizes it by just invoking it's name? Thanks
|
|
|
Post by George on Jan 3, 2019 11:36:24 GMT -5
Jayg:
OK, I played with a test script, and this seems to work.
/* REXX */
ADDRESS CMD 'START "C:\Program Files (x86)\SPFLite\SPFLite.exe" "E:\GDrive\Test Data\Test1.txt"'
call syssleep 2
ADDRESS CMD 'START "C:\Program Files (x86)\SPFLite\SPFLite.exe" "E:\GDrive\Test Data\Test2.txt"'
The syssleep is needed to allow the 1st SPFLite to initialize and get it's window open. Otherwise, the 2nd file does not "see" the 1st copy and simply opens the 2nd file in a totally separate instance. Experiment with the # of seconds to get a reliable result on your system.
George
|
|
|
Post by George on Jan 3, 2019 12:41:40 GMT -5
Syssleep is a standard Rexx function
George
|
|
jayg
Freshman Member
Posts: 9
|
Post by jayg on Jan 3, 2019 13:49:25 GMT -5
Thanks guys, both solutions worked. Adding the path to Environment Variables allowed me to open 2 files at once in different windows.
|
|
|
Post by George on Jan 4, 2019 12:50:34 GMT -5
Jayg: Glad you've got a working solution.
George
|
|