View Full Version : Console not the same when bundled
EmbeddedMan
16-09-2015, 23:02
If I take the SampleScripts\Console\Console_Info.tbasic program and run it from within thinAir, it works just like I would expect - it outputs all of it's text to the cmd windows that is brought up when run.
If I run it from the command line like so:
C:\thinBasic\SampleScripts\Console>thinbasicc Console_Info.tbasic
it also runs exactly as I expect - it uses the existing command shell console to output it's text to.
But when I bundle it and run it from the command line, it opens up it's own console rather than using the existing command shell console.
To me this doesn't match what I understand about .tbasic vs .tbasicc files.
If this file were a .tbasicc file and it were run from a bundle, I would expect it to open up it's own console. But it is not - it's just a .tbasic file. Shouldn't it use the existing console?
(This is with 1.9.15.0)
*Brian
ErosOlmi
17-09-2015, 09:08
Well,
you are finding all current limitations :)
Current bundling process is able to just creates GUI executable regardless of thinBasic extensions (.tBasic, tBasicc).
GUI executable is not recognized by the operating system as Console application and for this reason are not executed inside the command prompt from which it is executed.
Even if the GUI application is able to use and write into a Console ... the operating system does not use the current console but opens a new one.
I do not exclude that in future versions of thinBundle I will be able to differentiate the two kind of executable.
I have to check how to do.
Ciao
Eros
EmbeddedMan
17-09-2015, 15:47
Eros,
Sorry! :-) It's not that big a deal to me for this application, but I can see this being a problem if somebody wanted to make a true 'command line' program that operated just like another DOS command.
In any case, thanks so much for being so responsive to all of my silly little requests. I'm really enjoying learning ThinBasic and absolutely love the language for quick little PC apps. It's so much fun to program in TB!
*Brian
ErosOlmi
23-09-2015, 23:05
I think I've done this new option.
Next version will have the possibility to create GUI or Console Bundled executable.
It will be determined into two possible modes:
if script extension will be .tbasic a GUI bundled application will be created
if script extension will be .tbasicc a Console bundled application will be created
second option is to force inside the script using something like:
#BUNDLE Type Console
#BUNDLE Type Gui
Ciao
Eros
EmbeddedMan
28-09-2015, 17:30
Sounds great Eros! Thanks,
*Brian
EmbeddedMan
07-09-2016, 17:33
Eros - so I'm now running 1.9.16.17, and I bundled a simple .tbasicc program, and I _still_ can't stop it from opening its own command prompt when I call the resulting .exe file from the command line.
Do you have a simple example that demonstrates using console output, which, when bundled to a .exe and run from the command line re-uses the CMD command window rather than opening it's own?
Thanks so much-
*Brian
ErosOlmi
07-09-2016, 22:15
Hi Brian,
with recent version I added new #BUNDLE ... commands and one of those commands is #BUNDLE TYPE CONSOLE
This instruct Bundle to create a real console application instead of a GUI application opening a concole window
See help at http://www.thinbasic.com/public/products/thinBasic/help/html/index.html?bundle_type.htm
When you bundle your script it will intercept #BUNDLE TYPE CONSOLE command.
Example:
#BUNDLE Type Console
uses "console"
printl "Hi there"
waitkey
Let me know if it works
Eros
EmbeddedMan
07-09-2016, 22:40
Yes! That was the magic! Thank you so much Eros - my bundled app is now staying within the original windows cmd console.
*Brian