@SCRIPT does not like all comments

Using;
Code:
TCC  16.03.54  Windows Vista [Version 6.0.6002]
TCC Build 54  Windows Vista Build 6002  Service Pack 2

I am converting some of my larger VBScripts to TCC functions, using a utility that I created, vbs2Function.exe

Example;
Code:
a=10
a=a+1
'Create a console for output
set fso=CreateObject("Scripting.FileSystemObject")
set stdout=fso.GetStandardStream(1)
stdout.WriteLine a
Rem This is a comment

runs properly using
Code:
cscript //nologo test.vbs
and converts to this;
Code:
function test=`%@script[vbscript,a=10:a=a+1:'Create a console for output:set fso=CreateObject("Scripting.FileSystemObject"):set stdout=fso.GetStandardStream(1):stdout.WriteLine a:Rem This is a comment:]`

Running this as
Code:
echo %@test[]
returns nothing but the prompt.

The reason for this is the first comment. If I remove the first comment from the @script function, it works properly with no problem.

It appears that, when using the @script function, comments are allowed only at the end of the command. If comments are placed anywhere else in the @script function, execution halts.

Why is this?

Joe
Code:
TCC  16.03.54  Windows Vista [Version 6.0.6002]
TCC Build 54  Windows Vista Build 6002  Service Pack 2
 
May 30, 2008
67
1
It appears that, when using the @script function, comments are allowed only at the end of the command. If comments are placed anywhere else in the @script function, execution halts.

Why is this?
In vbscript ' is a line comment, in other words, everything from that char until the end of line (#13#10) will be treated as a comment.
(The same is true for jscript's // comment)
If you place it at the end of the code it obviously won't matter, because no code follows.

I'm not sure if vbscript has a block comment equalient (iow, similar to jscript's /*comment*/)
 
Similar threads
Thread starter Title Forum Replies Date
Joe Caverly .PS1 script does not work with PSHELL Support 11
Joe Caverly SCRIPT and GetObject Support 3
vefatica SCRIPT ... TCC disappears Support 2
T How can I send a simple parameter to a script, in tc 25? Support 2
vefatica PSHELL: How pass arguments to script? Support 15
EDerH Powershell call from script Support 24
MickeyF running program from script and (not) returning to script Support 12
T Fixed Echo randomly activated in script Support 4
fpefpe How to? script error Support 1
fpefpe How to? script error Support 0
vefatica @SCRIPT bug persists Support 4
D Catching the result of an evaluated script expression Support 0
Joe Caverly Non-conforming @Script Support 6
M The Matrix: a useless script ... Support 5
fpefpe How to? LUA script Support 0
T Change language in script Support 4
Steve Pitts Documentation Script errors invoking help Support 15
R How to? Launch and execute commands in tcmd.exe through MSBuild Script. Support 3
Mordachai Help! How to set parameters for script I'm debugging?! Support 6
fpefpe How to? Script support Support 8
JohnQSmith "SCRIPT" Support 7
rconn Script kiddies on the attack Support 4
krischik Stop Script after Syntax Error. Support 6
H Ruby - Running External Ruby script crashes TCC Support 11
Joe Caverly SCRIPT Command Support 2
T Obfuscating passwords in script Support 14
Stefano Piccardi IDE.exe start toobar button fails when % in script path Support 0
lassevk exit(1) in a python script exits console, by design or bug? Support 1
R break script on syntex error Support 7
K iftp script copy deletes target files Support 17
R script problem with mapped network drive Support 1
D Parsing an array variable to an array does not work Support 5
J Take command does not start on Windows 10 Support 3
J ffind does not find files Support 4
Joe Caverly PAUSE does not erase countdown timer Support 0
D ParentDirectory does not update directory history Support 6
D Documentation Help "Startup" page does not describe global lists Support 0
Charles Dye Does HASH's /E option do anything? Support 1
fishman@panix.com First TCC instantiation after reboot does not work. Support 17
D Fixed @VERSION does not increment pre-fixed version numbers. Support 1
vefatica Why does @WSLPATH double the leading '/'? Support 7
D What does the file "..\Everything\Run history.csv" store? Support 5
Peter Murschall WAD rem does not work correctly Support 8
vefatica Does @SYMLINK work? Support 6
R Tree on FAT32 does not sort by name by default. Support 6
A Tcc does not recognize "bcdedit" Support 20
MickeyF Why does this batch file give me 'unknown command "else"' error? Support 17
M Ctrl-C when using command line history does nothing Support 2
vefatica JOBS /K ... how does it work? Support 5
Joe Caverly Why does TCCRT return VIEW as an internal command? Support 6

Similar threads