Posts: 149
Threads: 32
Joined: Feb 2005
First off I have to say THANK YOU to everyone who works on FB and the FBIDE. This is exactly what I was looking for to use in teaching my physics classes! QB was great and now it lives again.
On to the question.....
Is it possible, or have I over looked a way, to have FBIDE wait for a key press before closing the console box when a program is run from the IDE. Like QB's "Press any key to continue" at the end of a piece of code run from the IDE.
This would be a bit easier than having to go to the command prompt to run the compiled exe.
Thanks again,
Posts: 1,774
Threads: 62
Joined: Aug 2003
You could just add this...
Code:
PRINT "PRESS ANY KEY TO CONTINUE..."
SLEEP
Posts: 149
Threads: 32
Joined: Feb 2005
Yes, and that is what I have done.... in each and every prog I've done. :-?
It would just be "nice"
if the old QB method could be there and you didn't have to worry about it; provided the code was run in the IDE.
<WARNING, stretching the limits of my programming understanding. To paraphrase; Damn it Jim I'm a physicist, not a programmer! So don't mock me too badly
>
I didn't know how difficult that would be. My assumption would be something to the effect that in code you would watch for when the window was ready to unload (like a Query_Unload event in VB) and add the needed code. If this could be done in the IDE, I don't know (hook into the console window?) or if it'd have to be done in the compiler (accept a command-line pass to it, "Hey this is a run in the IDE so let's pause at the end").
Posts: 1,752
Threads: 21
Joined: Jun 2002
I agree this would also be useful. It should be easy to implement; all the IDE would have to do is make a batch file with the lines
and then run the batch file instead of the exe directly. (QB4MED does this, but it's not for FB. Yet.)
Posts: 3,279
Threads: 170
Joined: Nov 2003
VonGodric's IDE doesn't actually run applications inside it, it just spawns them. So the batch file method is the only choice there.
I'd knock on wood, but my desk is particle board.
Posts: 658
Threads: 71
Joined: Sep 2003
Yep batch files only solution, but it be stupid...
url]http://fbide.sourceforge.net/[/url]
Posts: 149
Threads: 32
Joined: Feb 2005
Why? Would you care to explain that?
Posts: 31
Threads: 3
Joined: Dec 2004
In Visual C++ if you have a program with a console window, if you run with ctrl+F5 (dunno what the name is in the menu) it will wait for a keypress in the console window before exiting. If you just run with F5, it won't wait and just quit (like a normal program?)
Posts: 1,774
Threads: 62
Joined: Aug 2003
What if:
When the user runs his/her program, the IDE always compiles and runs a temp copy. All you need to do is find where the program exits and add the appropriate lines to the end of the temp file... and it could still compile the permanent executable, it just wouldn't run it or add those lines.
Posts: 780
Threads: 49
Joined: Dec 2001
Using a batch file is a much more logical way and much easier way of doing it. In fact, it only really needs to be added to the QuickRun thing that you've implement, Von, and it really isn't a whole deal to reprogram.
As for actually hooking into the console window...yeah...I am pretty sure it's possible...but it's dirty and not worth it.