EmbeddedMan
15-09-2015, 15:54
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
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