Author |
Topic: Run one program from within another. (Read 1175 times) |
|
TheFamousCash
New Member
member is offline


Posts: 16
|
 |
Re: Run one program from within another.
« Reply #6 on: Mar 21st, 2015, 5:47pm » |
|
I spent some time experimenting before acknowledging your kind response because I felt certain there must have been something wrong with my coding.
I wrote an elementary program to check all permutations and discovered *RUN is (of course) the solution. The reason, (at least, I am pretty sure) concerns the fact my original program used full screen. The secondary program which was *RUN from the original was, in fact, running in the background although no input was accepted and was not visible.
One problem yet to solve. . . I understand a program cannot delete itself but the installation program (on disc) copies files, including the user's main program, to the computer then deletes them from the disc. (No problem.) It then goes on to use *RUN to run the newly installed users main program from the computer. (Now successful with the above problem now solved.)
That main program (before proceeding to operate properly) now attempts to delete the installation program from the disc which is still waiting for the user's program to terminate. It does not do so and there is no error message. I am assuming it is because it is not possible to delete from disc because it is running.
When the program is exited and the newly installed shortcut is clicked to run the users main program, it DOES delete the installation program from disc, if it is still in drive.
Thank you once again for your patience and invaluable help.
Regards,
Bob.
|
|
Logged
|
|
|
|
rtr2
Guest
|
 |
Re: Run one program from within another.
« Reply #7 on: Mar 21st, 2015, 6:20pm » |
|
on Mar 21st, 2015, 5:47pm, TheFamousCash wrote:| The reason, (at least, I am pretty sure) concerns the fact my original program used full screen... |
|
IMO you need to have a very good reason for running full screen. This laptop display is 1920 x 1080 pixels, which is an awful lot of real estate to be filled with just one program, however awesome its designer thinks it is! So if, as a result, your calling program obscured the called program I have no sympathy whatever. 
Anyway, if the calling program is no longer needed, why do you leave it running? As I said before, there is no reason why it shouldn't do a QUIT as soon as the external process has been successfully spawned.
Richard.
|
|
Logged
|
|
|
|
TheFamousCash
New Member
member is offline


Posts: 16
|
 |
Re: Run one program from within another.
« Reply #8 on: Mar 21st, 2015, 7:11pm » |
|
I am aware of your dislike for programs using full screen and I agree in principle. There is no point in justifying why I used it in this particular program, it just happens it caused the problem.
Unless I am mistaken, if I *RUN a program from within another, I can't exit the program before executing the command.
The next command after the *RUN command is *QUIT.
If I *QUIT, I can't then *RUN as the program has terminated.
Bob.
|
|
Logged
|
|
|
|
rtr2
Guest
|
 |
Re: Run one program from within another.
« Reply #9 on: Mar 21st, 2015, 9:16pm » |
|
on Mar 21st, 2015, 7:11pm, TheFamousCash wrote:| The next command after the *RUN command is *QUIT. If I *QUIT, I can't then *RUN as the program has terminated. |
|
I don't follow. I was suggesting that you *RUN the external program without waiting for it to complete (semicolon terminator), then immediately execute a QUIT statement in the calling program. That way there's only a very short 'overlap' during which both programs are running simultaneously. That's the closest you can get to a CHAIN-like behaviour with EXEs, which I thought was what you wanted. Maybe I misunderstood.
I should perhaps say, in all fairness, that what you are trying to achieve would be significantly easier in Liberty BASIC!
Richard.
|
| « Last Edit: Mar 21st, 2015, 9:18pm by rtr2 » |
Logged
|
|
|
|
TheFamousCash
New Member
member is offline


Posts: 16
|
 |
Re: Run one program from within another.
« Reply #10 on: Mar 23rd, 2015, 3:12pm » |
|
Just for completeness.
I have successfully achieved the goal.
Customer's disc contains an "exe" "INSTALL" program and a folder containing his main "exe" program and associated files.
Activating the "INSTALL" program loads the contents of the folder (main program and files) to customer's computer and deletes all files (including the "INSTALL" program) on the disc. The main program is then *RUN.
Many thanks, once again, for your invaluable help and patience.
Regards,
Bob.
|
|
Logged
|
|
|
|
|