Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
A FBIDE Question... "Hit Any Key..." like in QB?
#1
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,
Reply
#2
You could just add this...

Code:
PRINT "PRESS ANY KEY TO CONTINUE..."
SLEEP
Reply
#3
Yes, and that is what I have done.... in each and every prog I've done. :-?

It would just be "nice" Big Grin 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 Tongue >

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").
Reply
#4
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

Code:
yourprog.exe
pause

and then run the batch file instead of the exe directly. (QB4MED does this, but it's not for FB. Yet.)
Reply
#5
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.
Reply
#6
Yep batch files only solution, but it be stupid...
url]http://fbide.sourceforge.net/[/url]
Reply
#7
Why? Would you care to explain that?
Reply
#8
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?)
Reply
#9
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. Wink
Reply
#10
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.
·~¹'°¨°'¹i|¡~æthérFòx~¡|i¹'°¨°'¹~·-
avinash.vora - http://www.avinashv.net
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)