Console off

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

Re: Console off

Postby UEZ » Jul 29, 2019 21:32

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: 2964
Joined: Nov 04, 2005 14:23
Location: Ontario, Canada
Contact:

Re: Console off

Postby coderJeff » Aug 05, 2019 15:42

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: 338
Joined: Dec 28, 2012 13:31
Location: Paris - France

Re: Console off

Postby marpon » Aug 06, 2019 7:28

See different console possibilities with windows

https://www.freebasic.net/forum/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

Return to “Beginners”

Who is online

Users browsing this forum: Bing [Bot] and 10 guests