View Full Version : difference between .tbasic and .tbasicc
sandyrepope
21-05-2008, 23:58
Sorry, but I'm having trouble understanding something about console programs.
What is the differences between using .tbasic and .tbasicc extensions when writing console programs?
Thanks
Sandy
ErosOlmi
22-05-2008, 00:07
Sandy,
.tBasic script are executed by thinBasic.exe that is a native Win32 GUI application
.tBasicc script are executed by thinBasicc.exe that is a native Win32 Console application (when executed, an automatic console window is opened even if you do not need it)
In both cases, to use console commands, you need to add USES "Console" statement inside scripts.
The real big difference between the 2 executable is that thinBasicc.exe can handle standard input/output.
It was mainly created in order to be able to use thinBasic script as server side script in web servers. More or less like PHP scripts.
My suggestion is to always use .tBasic scripts and not .tbasicc unless you really need it.
To use console commands just add USES "Console" in your script.
Eros
sandyrepope
22-05-2008, 15:52
The real big difference between the 2 executable is that thinBasicc.exe can handle standard input/output.
What is standard input/output?
Thanks
Sandy
ErosOlmi
22-05-2008, 16:30
Standard_streams
Well, not easy to reply in details.
Mainly it is the possibility to send the output of a program as the input of another.
A classical and easy example is using the DIR command and send its output (the list of the files) os input of the MORE command in order to be shown by pages. To achieve this it is normally used the | symbol (called pipe)
Example.
Open a console command prompt and type DIR in a directory that have more that 30/50 files:
DIR *.*
Now do the same piping DIR output as input of MORE command:
DIR *.* | MORE
This command redirect the output of DIR to be the input of MORE.
Back to thinBasic, the Console version of thinBasic is able to handle this.
Ciao
Eros
sandyrepope
22-05-2008, 23:29
Thank you for the reply. It helps.
Currently I'm working on a script for a friend and it uses console_write and console_writeline for output. It expects all input to come from the keyboard. As near as I can tell, using the .tbasicc would be fine for it. It's a simple version of the Lemonade Stand game.
Thanks
Sandy
paravantis
30-08-2024, 16:49
Was wondering about this very question … 16 years after the original post!