- Aug
- 2,028
- 82
Using;
I am converting some of my larger VBScripts to TCC functions, using a utility that I created, vbs2Function.exe
Example;
runs properly using
and converts to this;
Running this as
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
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
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[]
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