Results 1 to 5 of 5

Thread: thinbasic command line?

  1. #1

    thinbasic command line?

    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

  2. #2
    thinBasic author ErosOlmi's Avatar
    Join Date
    Sep 2004
    Location
    Milan - Italy
    Age
    57
    Posts
    8,777
    Rep Power
    10

    Re: thinbasic command line?

    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
    [code=dos]thinBasic.exe DoubleClickedScriptName.tBasic[/code]
    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

    www.thinbasic.com | www.thinbasic.com/community/ | help.thinbasic.com
    Windows 10 Pro for Workstations 64bit - 32 GB - Intel(R) Xeon(R) W-10855M CPU @ 2.80GHz - NVIDIA Quadro RTX 3000

  3. #3
    thinBasic author ErosOlmi's Avatar
    Join Date
    Sep 2004
    Location
    Milan - Italy
    Age
    57
    Posts
    8,777
    Rep Power
    10

    Re: thinbasic command line?

    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
    www.thinbasic.com | www.thinbasic.com/community/ | help.thinbasic.com
    Windows 10 Pro for Workstations 64bit - 32 GB - Intel(R) Xeon(R) W-10855M CPU @ 2.80GHz - NVIDIA Quadro RTX 3000

  4. #4

    Re: thinbasic command line?

    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

  5. #5
    thinBasic MVPs kryton9's Avatar
    Join Date
    Nov 2006
    Location
    Naples, Florida & Duluth, Georgia
    Age
    67
    Posts
    3,869
    Rep Power
    404

    Re: thinbasic command line?

    THanks for the example Eros.
    Acer Notebook: Win 10 Home 64 Bit, Core i7-4702MQ @ 2.2Ghz, 12 GB RAM, nVidia GTX 760M and Intel HD 4600
    Raspberry Pi 3: Raspbian OS use for Home Samba Server and Test HTTP Server

Similar Threads

  1. CAD command line
    By Petr Schreiber in forum Real world situations and solutions using thinBasic
    Replies: 3
    Last Post: 13-10-2007, 21:03

Members who have read this thread: 0

There are no members to list at the moment.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •