Qbasicnews.com

Full Version: Behaviour of RUN
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I keep compiling old sources, being extremely pleased with the results. Awesome work Smile

I've found that RUN by itself is not supported. In QB, RUN just runs the current program again from scratch.

In FB you especify something like

Code:
RUN "foo.exe"

My question is: Would this be the same?:

1.- QB CODE, GAME.EXE:

Code:
' ... blah
   RUN ' start over

2.- FB CODE, GAME.EXE:
Code:
' ... blah
   RUN "GAME.EXE" 'start over

Will the FB code run another instance of GAME.EXE or it will unload the current GAME.EXE and start executing it from the start?

I'm fearing that the execution of something like:

Code:
' this is PROGGIE.EXE
RUN "PROGGIE.EXE"

bloats the memory with instances of PROGGIE.EXE. What's the exact behaviour of RUN?

It's so late, I can't think in English. I hope you understand Big Grin
nobody knows... :lol:
You try it =), I'm not gonna kill my comp. with a rabbit program Big Grin
Ops, didn't see this msg.. my bad.

Nope, RUN will kill the current process, only CHAIN and EXEC will continue when the callee process return.

Try this:

Code:
'' test.bas

input "Run again?", again$

if( ucase$( again$ ) = "Y" ) then
    run "test.exe"
end if

Check the task manager, there will be just one instance of test.exe there - unless 9x does some kind of crap, tested with XP only.
Just what I needed. Thanks.