IonicWind Software

IWBasic => Console Corner => Topic started by: billhsln on July 16, 2014, 03:14:46 PM

Title: End Prompt
Post by: billhsln on July 16, 2014, 03:14:46 PM
I am running the most current version IWB.  My question is, when I create a console program, some times I have it ask to hit a key and it asks again and some times it does not.  Is there a switch that I need to either turn on or off?  The reason I ask, I have some programs that I don't want to have it ask me to press any key, I just want them to end and they end up asking me even when I don't ask for it.  And some times it ends up asking because I request it and then it asks again, which is annoying.

Thanks,
Bill
Title: Re: End Prompt
Post by: LarryMc on July 16, 2014, 07:35:09 PM
Let's see if I can explain it correctly.
When you compile a program as a console application you are always going to get a "Press any key to continue . . ." message; Period!  It is internally programmed that way. And the message is generated when the END statement is encountered.

It you precede the END statement with WAITCON or DO:UNTIL inkey$<>"" then you will get that prompt also just prior to the one above.

Now, if you have a "console" program(no windows other than maybe a messagebox) you can compile it as a windows application.

Now, when the END statement is encountered the console window will close, if it was open.
In this case the console window will open only if you print to it or you use the OPENCONSOLE statement.
You can use the WAITCON command to require the user to hit a key to close the window.