PDA

View Full Version : thinbasic command line?



sandyrepope
01-08-2007, 16:37
As I understand, thinbasic has a command line. I read somewhere in the forum that it is:

thinBasic <ScriptName> [script parameters].

What is a command line and what are script parameters?

I probably should know this but I don't.

Thanks
Sandy

ErosOlmi
01-08-2007, 17:07
thinBasic scripts can be invoked in many different ways:

by a double click on Windows shell
executed by a command inside a console window
executed by another script or a scheduling application
executed by a batch file (.Bat or .Cmd)


When you execute a script by double click on script file name, automatically the command passed to the operating system is

thinBasic.exe DoubleClickedScriptName.tBasic
so you have no way to pass other info to the script (command line parameters)

But when you execute in a not interactive way, you can pass other info to the script and get those info (called parameters) using OS module and few specific functions.

To have a look see \SampleScripts\OS\ directory.
You should find a Test.Bat file that executes OS_SampleCommandLine.tbasic script passing two parameters. Than look inside OS_SampleCommandLine.tbasic and see how to parse command line params.

Ciao
Eros

ErosOlmi
01-08-2007, 17:24
Mentioned .bat file is not included in standard thinBasic distribution.
Find here test.bat and script file you can use to see script command parameters in action.

Ciao
Eros

sandyrepope
01-08-2007, 17:31
Thank you for the zip file. I was wondering why I couldn't find the test.bat file. I'll check it out as soon as I can.

Thank you
Sandy

kryton9
02-08-2007, 04:29
THanks for the example Eros.