What do you mean “cannot use parentheses?” – Fabulous Adventures In Coding – Site Home – MSDN Blogs
Posted by jpluimers on 2013/04/25
Ah, VBScript. It just wouldn’t be the same without these quirky gotchas.
So either perform Call, assign the function result, or use less parenthesis.
Another thing that drives me crazy with VBScript is that you can only specify ByVal or ByRef, but not specify what type a parameter (string, integer, etc) will be.
VBScript will just barf with “Microsoft VBScript compilation error: Expected ‘)’” at the first As. or colon (:) when you declare Sub or Function parameters like this:
- Function Describe(ByVal FileName As String, ByVal Description As String)
- Function Describe(ByVal FileName : String, ByVal Description : String)
The reason is that the colon is end-of-statement token, which means you can string statements together, an can Dim and assign a variable in one line:
- Dim PathName : PathName = FileName
To quote ebgreen:
Oh and Debugging VBScript is indispensable (:
–jeroen
via: What do you mean “cannot use parentheses?” – Fabulous Adventures In Coding – Site Home – MSDN Blogs.
Leave a Reply