Qbasicnews.com
Writing to the Console window while still having a Screen - Printable Version

+- Qbasicnews.com (http://qbasicnews.com/newforum)
+-- Forum: Qbasic "like" compilers/interpreters (http://qbasicnews.com/newforum/forum-5.html)
+--- Forum: FB Discussion & Programming Help (http://qbasicnews.com/newforum/forum-15.html)
+--- Thread: Writing to the Console window while still having a Screen (/thread-8536.html)



Writing to the Console window while still having a Screen - TheDarkJay - 12-10-2005

How can i print something to the Console Window while still having a Screen open?

I mean something like

SCREENRES 320,200,32,,0
PRINT.TO.Console "Hello World"


Writing to the Console window while still having a Screen - yetifoot - 12-10-2005

heres an example from antoni

http://www.freebasic.net/forum/viewtopic.php?t=117&highlight=console


Writing to the Console window while still having a Screen - TheDarkJay - 12-10-2005

Doesn't seem to work for me... Sad


Writing to the Console window while still having a Screen - yetifoot - 12-10-2005

no me neither sorry didnt test, change to this

Code:
screen 12
open "CONS" for output as #1
print #1 ,"Hello"
sleep



Writing to the Console window while still having a Screen - TheDarkJay - 12-11-2005

Quote:no me neither sorry didnt test, change to this

Code:
screen 12
open "CONS" for output as #1
print #1 ,"Hello"
sleep

That works fine...thx. debugging code just became a whole lot easier


Writing to the Console window while still having a Screen - d.j.peters - 12-13-2005

Code:
#define DEBUG
#ifdef DEBUG
#  define dprint(msg) open err for output as #24:print #24,"debug: ";msg:close #24
#else
#  define dprint(msg):
#endif
dprint("any debug messages")

If you have for example 100 Lines of debug messages in your code and all works you must remove it all for a final version.

only remove the first line #define DEBUG and all dprint() calls are removed from your code without to do it manualy.

Try it out and have fun.

Joshy