Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsVB SyntaxEnterprise DevelopmentDatabase AccessControlsCOMWin APICrystal ReportDeploymentGeneralGeneral 2
Related Topics
VB.NET / ASP.NETMS SQL ServerMS AccessOther Database ProductsMore Topics ...

VB Forum / Controls / September 2004



Tip: Looking for answers? Try searching our database.

an array of user defined data type as a parameter for the class method?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
vlad - 28 Sep 2004 14:45 GMT
how and where do I declare user data type to be able to pass an array of
this user data type as a parameter for the class method? Now I get an error
that I shoul declare it in a public object module, but all the objects
modules in a project seem to be private.

thanks, vlad.
Ishan Bhalla - 29 Sep 2004 00:55 GMT
the user data types should be declared as public in the class that u wish to
share!!

Regards,
Ishan

> how and where do I declare user data type to be able to pass an array of
> this user data type as a parameter for the class method? Now I get an error
> that I shoul declare it in a public object module, but all the objects
> modules in a project seem to be private.
>
> thanks, vlad.
vlad - 29 Sep 2004 10:33 GMT
This only works if the class module is public, i.e. in ActiveX DLL or
ActiveX EXE. If the class module is a part of a common project then it is
not allowed..

The dessision I've found is to declare User defined type as a class itself.
I.e. I use a class with a public properties instead of the User defined
type. Of course an array should be declared as

private a() as new MyClass

for example.

thanks anyway,
vlad.

news:79BA8860-35FB-4DFB-9FA2-74ACF2DC6681@microsoft.com...
> the user data types should be declared as public in the class that u wish to
> share!!
[quoted text clipped - 8 lines]
> >
> > thanks, vlad.
Ken Halter - 29 Sep 2004 15:27 GMT
> The dessision I've found is to declare User defined type as a class itself.

You'll find that you've added a lot of (optional) functionality to your
app by replacing that tired old UDT with a class module <g> Range
checking, default settings, etc, etc are now easy to implement.

Signature

Ken Halter - MS-MVP-VB - http://www.vbsight.com
Please keep all discussions in the groups..

Ishan Bhalla - 29 Sep 2004 00:59 GMT
Just to add to the previous note:

Option Explicit

Public myInstance As myDataType

Public Type myDataType
  CPU As Variant
  Memory As Long
  VideoColors As Integer
  Cost As Currency
  PurchaseDate As Variant
End Type

Regards
ishan

> how and where do I declare user data type to be able to pass an array of
> this user data type as a parameter for the class method? Now I get an error
> that I shoul declare it in a public object module, but all the objects
> modules in a project seem to be private.
>
> thanks, vlad.
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.