Zip Component, Email Component, Encryption Component ActiveX Control for Zip Compression .NET Components for ASP.NET
ActiveX and .NET Components for Zip Compression, Encryption, Email, XML, S/MIME, HTML Email, Character Encoding, Digital Certificates, FTP, and more ASP Email ActiveX Component


Index of Chilkat Blog Posts

March 16, 2006

VB6 function calls vs. subroutine calls

In VB6, there is a difference between the syntax for a subroutine call and
a function call. The function call is a method with arguments in parentheses,
such as:

success = zip.UnzipMatching("unzipDir","*.jpg",1)

You could also call it as a subroutine, but you *must* leave off the parens:

zip.UnzipMatching "unzipDir", "*.jpg", 1

A function with one argument might seem confusing, because both seem to work:

zip.OpenZip ("test.zip")

and

zip.OpenZip "test.zip"

However, VB6 recognizes the function parameter list by the commas, so the ("test.zip") is just
an expression. You’ll notice that VB6 will insert a space between the method name and
the left paren. However, if you call it as a function, no space is inserted:

success = zip.OpenZip("test.zip")


Privacy Statement. Copyright 2000-2011 Chilkat Software, Inc. All rights reserved.
Send feedback to support@chilkatsoft.com

Components for Microsoft Windows XP, 2000, 2003 Server, Vista, Windows 7, and Windows 95/98/NT4.