Passing Public user-defined types via Public Functions
<Excluding Classes, which I avoid>
You can pass a UDT to a form or sub procedure by declaring it as the
parameter ...
Type ClientData
....
End Type
Sub XXX (CL as ClientData)
.....
Function YYY (CL as ClientData) As <your choice>
.....
What you can't do is :
Function YYY () As ClientData
.....
But since the declare is Public, it's already available to the other
procedures.
You also can not define the Type as anything but Private in the form-level
general declarations; use a BAS module.
--
Randy Birch, MVP Visual Basic
Moderator, Fidonet Visual Basic Programmer's Conference
VBnet, The Visual Basic Developers Resource Centre
http://www.*-*-*.com/
: Maybe someone can lend some insight .I have created a project using
: VB4. It contains a main module with PUBLIC user-defined types. I want
: to pass these types around using PUBLIC functions in the various other
: modules. I consistently get an error message which says " I cannot use
: user-defined types as the type of a public function" . The type of the
: function is integer. The user-defined type is being passed ByRef as an
: argument. So far the books are less than enlightening.
: