Calling a Declared Function

After you declare your function, you can call it from your code. The following code example shows how to call the CreateFile function.

fHandle = CreateFile("filename.txt", &H40000000, 0, vbNullPtr, 2, 0, 0)

When you call a declared function, the compiler may perform Variant type conversions on the data you pass to the function. For example, if you declare a parameter As String and then pass a number such as 0 through the parameter, VBScript may convert it to the string “0”.