Skip to end of metadata
Go to start of metadata

How do you know when to use parenthesis when calling the scripting functions?

For Older VBScript Scripts, you do not need parenthesis if the procedure is not returning a value:

If the function is returning a value, you need to surround the parameters with parentheses.  Otherwise, you need to omit them.  Here is a function call that does not return a value:

hs.Speak "This is a test"

The following function returns a status value:

Dim MyVal
MyVal = hs.DeviceValue(1234)

For VB.NET Scripts, parenthesis are always used.

hs.Speak("This is a test")

Dim MyVal As Double
MyVal = hs.DeviceValue(1234)

For C# scripts, the format is the same a C#.


Are the function names case-sensitive?

Not for VBScript or VB.Net scripts.  The function hs.Speak("Test") and hs.speAK("Test") are identical and work the same way. For C# scripts, they are case sensitive.

  • No labels