April 23, 2024, 09:47:12 PM

News:

Own IWBasic 2.x ? -----> Get your free upgrade to 3.x now.........


Console window 'discovery'?

Started by LarryMc, April 17, 2012, 08:04:21 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

LarryMc

I just 'discovered' something that maybe everyone else already knew.
Hell, with my memory I may have known it before.

I had always assumed console programs had to be compiled with the CONSOLE target.
It turns out you can compile console programs with the WINDOWS target.

So, what difference does it make?
CONSOLE target:
 you can use OPENCONSOLE/CLOSECONSOLE or not; it doesn't matter.
 you don't need any sort of loop at the end of your program unless you want a specific key to end the program
 the "Press any key to continue . . ." message ALWAYS appears regardless of how you try to end your program

WINDOW target:
 OPENCONSOLE/CLOSECONSOLE are mandatory in order to do any output
 a loop IS required at the end of the program to keep the app from closing before the user is ready
 the "Press any key to continue . . ."  message does not automatically appear.

so, if you have a console app that you want to run and completely close without any user action simply leave out any close loop
and compile as a WINDOW.  It'll act sort of like an old time DOS BATCH file.

Do remember that even though you compile it to a WINDOW target you can NOT use any GUI type functions.

LarryMc
LarryMc
Larry McCaughn :)
Author of IWB+, Custom Button Designer library, Custom Chart Designer library, Snippet Manager, IWGrid control library, LM_Image control library