Results 1 to 4 of 4

Thread: Command parameters different when run as bundle

  1. #1

    Command parameters different when run as bundle

    If you run the OS_SampleCommandLine.tbasicc sample by itself on the command line with three arguments, you get this

    C:\thinBasic\SampleScripts\OS>thinBasicc OS_SampleCommandLine.tbasicc Arg1 Arg2 Arg3
    The following are the passed parameters (param 1 is always script name):
    -------------------------------------------------------------------------------
    00 [OS_SampleCommandLine.tbasicc Arg1 Arg2 Arg3]
    01 [OS_SampleCommandLine.tbasicc]
    02 [Arg1]
    03 [Arg2]
    04 [Arg3]
    Press a key to Continue
    
    But if you bundle the script, and then run it like this:
    C:\thinBasic\SampleScripts\OS>OS_SampleCommandLine.exe Arg1 Arg2 Arg3
    
    You get the following:
    The following are the passed parameters (param 1 is always script name):
    -------------------------------------------------------------------------------
    00 [Arg1 Arg2 Arg3]
    01 [Arg1]
    02 [Arg2]
    03 [Arg3]
    Press a key to Continue
    
    Shouldn't the bundled script act the same as the non-bundled script? With the existing behavior, you have to write special code to detect if you're running as a bundle or not and switch around which arguments are which.

    As a separate but related issue, why does the script not see any parameters when invoked as follows?

    C:\thinBasic\SampleScripts\OS>OS_SampleCommandLine.tbasicc Arg1 Arg2 Arg3
    The following are the passed parameters (param 1 is always script name):
    -------------------------------------------------------------------------------
    00 ["C:\thinBasic\SampleScripts\OS\OS_SampleCommandLine.tbasicc"]
    01 ["C:\thinBasic\SampleScripts\OS\OS_SampleCommandLine.tbasicc"]
    Only 1 parameter, program stopped. Press a key to Continue
    
    Is there any documentation on these three forms of command line argument behavior for ThinBasic anywhere? I searched through the help file but couldn't' find anything. (this is with 1.9.15.0)

    *Brian

  2. #2
    thinBasic author ErosOlmi's Avatar
    Join Date
    Sep 2004
    Location
    Milan - Italy
    Age
    57
    Posts
    8,782
    Rep Power
    10
    Yes, they should be the same but, as you already discovered, bundled executable is a very new feature and there are still bugs.
    I will check and fix asap.

    I'm currently working on it checking all behaves.

    Thanks for reporting
    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,782
    Rep Power
    10
    I've fixed different behave of command line.
    Now source code execution and bundled executable will work equally.
    The only difference will be that when executing from source code, command line will contains script name while from bundled executable it will contain executable name.
    I will send you private message when I will have a new version to test


    Regarding the last problem where no arguments seems present ... I think it is related on how the operating system detect the application to run in order to execute *.tbasicc extension.
    I suppose it is related to the installation instructions I've setup when thinBasic installation is executed.
    I have to check it.
    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
    Eros,

    Yeah, that was my thought too. If you could make all three situations perform identically (or, like you said, the proper differences as to first parameter) it would make coding for command line scripts much simpler.

    Thanks-

    *Brian

Similar Threads

  1. TB 1.19.15.0 Bundle problem
    By EmbeddedMan in forum thinBasic General
    Replies: 8
    Last Post: 15-09-2015, 23:35
  2. Help: command line parameters
    By chliu in forum thinBasic General
    Replies: 4
    Last Post: 08-03-2012, 03:42
  3. Bundle updates
    By RobertoBianchi in forum thinBundle
    Replies: 4
    Last Post: 06-11-2008, 20:31
  4. Bundle required dll's
    By catventure in forum thinBundle
    Replies: 12
    Last Post: 29-04-2008, 08:07

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
  •