The Wiert Corner – irregular stream of stuff

Jeroen W. Pluimers on .NET, C#, Delphi, databases, and personal interests

  • My badges

  • Twitter Updates

    • RT @SwiftOnSecurity: To be fair, anyone who's tried to use VMware's website would probably rather see it deleted 32 minutes ago
    • RT @mmeeuw: “Je mag Joost Eerdmans niet vergelijken Anton Mussert en JoostAnnabel21 niet met de NSB, daar kunnen ze niet tegen, dan worden… 33 minutes ago
    • RT @roosvonk: Omdat enkele fabrieken van Tatasteel zo verouderd zijn dat ze extra veel vervuilen, hoeven ze niet te voldoen aan de strenge… 38 minutes ago
    • RT @zaagvis: Mijn moestuin is een kilometer van huis en ja ik ga altijd met de auto omdat ik zoveel mee moet slepen, nu dacht ik, als ik ee… 39 minutes ago
    • @Suuzer83 War heftig. Ik duim dat het stopt en wns je veel sterkte. 🤗 42 minutes ago
  • My Flickr Stream

  • Pages

  • All categories

  • Enter your email address to subscribe to this blog and receive notifications of new posts by email.

    Join 2,733 other followers

What do you mean “cannot use parentheses?” – Fabulous Adventures In Coding – Site Home – MSDN Blogs

Posted by jpluimers on 2013/04/25

Eric Lippert:

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:

VB is NOT VB.Net which is NOT VBA which is NOT VBScript

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

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.

 
%d bloggers like this: