Page 1 of 1

Error parsing the command-line arguments

Posted: Thu Aug 30, 2018 6:41 pm
by ostapvoip
Hello,
A simple TBS script

sub main()
for i = 1 to argc()
printl("Arg" # (i) # "=" # arg(i))
next
end sub

Result and incorrect result https://vgy.me/ykg5GQ.png

Re: Error parsing the command-line arguments

Posted: Fri Aug 31, 2018 9:42 am
by ostapvoip
P.S. When running via RUN, everything is fine
https://vgy.me/S2riI8.png

Re: Error parsing the command-line arguments

Posted: Sat Sep 01, 2018 3:35 pm
by TeraByte Support
the command terminal / prompt your using uses \ as an escape character to
say return the actual quote. So I believe you'd need to use \\" tell it to
treat the next \ as an actual \

"ostapvoip" wrote in message news:15611@public.tbosdt...

Hello,
A simple TBS script

sub main()
for i = 1 to argc()
printl("Arg" # (i) # "=" # arg(i))
next
end sub

Result and incorrect result

[
https://vgy.me/ykg5GQ.png
](https://vgy.me/ykg5GQ.png)



Re: Error parsing the command-line arguments

Posted: Sat Sep 01, 2018 8:09 pm
by ostapvoip
Added test

@echo off
:beginParseParams
if /i "%~1"=="" goto :endParseParams
echo %1
shift & goto :beginParseParams
:endParseParams

That is it is normal?
https://vgy.me/9jdtFU.png

And in my opinion it is an parsing error. 100%.

Re: Error parsing the command-line arguments

Posted: Wed Sep 05, 2018 3:56 am
by TeraByte Support
yes, it's normal. When you pass the parameters from the command prompt the
\" will escape the " to be a " and not the end of quoted string.

You can proves this by just setting up a run parameter

exec testit.exe "testing\" /123

You'll see it's:
testing\ /123

because cmd.exe didn't process the command line. Where as from cmd.exe it
will be:

testing" /123

You have the same type of issue with terminal / bash in linux.


"ostapvoip" wrote in message news:15616@public.tbosdt...

Added test

@echo off
:beginParseParams
if /i "%~1"=="" goto :endParseParams
echo %1
shift & goto :beginParseParams
:endParseParams

That is it is normal?

[
https://vgy.me/9jdtFU.png
](https://vgy.me/9jdtFU.png)

And in my opinion it is an parsing error. 100%.


Re: Error parsing the command-line arguments

Posted: Wed Sep 05, 2018 6:54 am
by ostapvoip
OK.
But why arguments in the RUN do not work like that? This is strange.
https://vgy.me/S2riI8.png

Re: Error parsing the command-line arguments

Posted: Wed Sep 05, 2018 7:05 pm
by TeraByte Support
because the command line is not be processed by cmd.exe


"ostapvoip" wrote in message news:15635@public.tbosdt...

OK.
But why arguments in the RUN do not work like that? This is strange.

[
https://vgy.me/S2riI8.png
](https://vgy.me/S2riI8.png)