Results 1 to 2 of 2

Thread: How to command line arguments in Thinbasic ?

  1. #1
    Member
    Join Date
    Aug 2015
    Location
    Keralam, India
    Posts
    118
    Rep Power
    17

    How to command line arguments in Thinbasic ?

    Hi all,
    I need to get the cmd line arguments in my script.
    OS_GetCommand(1)
    
    This is not working. Please help. Thanks in advance.

  2. #2
    Member
    Join Date
    Aug 2015
    Location
    Keralam, India
    Posts
    118
    Rep Power
    17

    Cool

    I found the answer.
    First, I experimented with OS_GetCommand at the middle of my script. Then I paste the code to start of the script and it worked. But It dosen't catch the string inside quotes. For example,
    Assume that these are command line args
    SampleText1 "Sample Sample Sample text2"
    I need thinbasic to extract this a 2 commands.
    1. SampleText1
    2. "Sample Sample Sample text2"

    But thinbasic is extracting this args like this.
    1. SampleText1
    2. "Sample
    See. It stopped reading when the first space occurrance.
    I can't use OS_CommandsSetSep here.

    Edit "---------------------------------------------"
    ThinBasic saved me again.
    I use this to solve the problem
    Dim FullCmd as String = OS_GetCommand(0)
    Dim WorkingDir As String = GRAB$(FullCmd, Chr$(34), Chr$(34))
    
    So I get the proper string. Thanks.
    Last edited by kcvinu; 04-05-2021 at 16:52.

Similar Threads

  1. Help: command line parameters
    By chliu in forum thinBasic General
    Replies: 4
    Last Post: 08-03-2012, 03:42
  2. how to extended a command to the next line
    By efly2020 in forum thinBasic General
    Replies: 5
    Last Post: 17-09-2008, 08:11
  3. CAD command line
    By Petr Schreiber in forum Real world situations and solutions using thinBasic
    Replies: 3
    Last Post: 13-10-2007, 21:03
  4. thinbasic command line?
    By sandyrepope in forum thinBasic General
    Replies: 4
    Last Post: 02-08-2007, 04:29

Posting Permissions

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