Console off

New to FreeBASIC? Post your questions here.
UEZ
Posts: 988
Joined: May 05, 2017 19:59
Location: Germany

Re: Console off

Post by UEZ »

This seems to work when adding -s gui to the building parameter.

Example: fbc.exe" -b "Test.bas" -gen gcc -Wc -Ofast -s gui

When you omit -s gui console will be shown by default.
coderJeff
Site Admin
Posts: 4326
Joined: Nov 04, 2005 14:23
Location: Ontario, Canada
Contact:

Re: Console off

Post by coderJeff »

dodicat wrote:You can use switch -s gui.
Example:
fbc -s gui myfile.bas
But make sure that myfile.bas is graphical, otherwise you might need the task manager to kill it.
I guess I missed the addition of __FB_GUI__ in the changelog; added in fbc 1.06.0

__FB_GUI__ could be used to make sure there is a graphical output. For example, this code will generate visible output regardless of '-s gui' given or not.

Code: Select all

#if __FB_GUI__
	'' compiled with '-s gui'?
	'' make sure we have an output screen
	screenres 640, 480, 8
#endif

dim shared colors(0 to 15) as zstring * 16 = { _
	"black", "blue", "green", "cyan", _
	"red", "magenta", "orange", "white", _
	"gray", "bright blue", "bright green", "bright cyan", _
	"bright red", "bright magenta", "yellow", "bright white" _
}

for i as integer = 0 to 15
	color i
	print colors(i)
next

sleep
This could allow an application to be compiled as console or gui application, but dependent on user code only for console or fbgfx (i.e. not necessarily win api application).
marpon
Posts: 342
Joined: Dec 28, 2012 13:31
Location: Paris - France

Re: Console off

Post by marpon »

See different console possibilities with windows

viewtopic.php?f=6&t=27500

even if compiled with -s gui option ( without console) , it is always possible to get (create) one
thats interresting to trace some info at running time
Post Reply