[x]
Posted via EE Mobile

Search, ask, and monitor your questions on the go with EE Mobile. Visit Experts Exchange from your mobile device and never be out of touch again.

Question
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

7.4

How to pass array of user-defined types to class object?

Asked by Jim_S in Visual Basic Programming, Delphi Components

Tags: defined, object, public, types, passed

I am using Visual Basic V6.0 SP5.  (Switching to VB.Net
is not a practical answer.)

I need to pass an array of user-defined types to
a method in a class object.  I get nothing but
"Compile error" messages.

Here are a few of the things I have tried and the message
generated.


********************************************************

cls1.cls

Public Type my_type
    Dim foo As Integer
End Type

Compile error:

     Cannot define a public user-defined type within a
     private object module.

---

What makes this object module private, and how could I
set it to be public.

********************************************************

cls1.cls

Private Type my_type
    Dim foo As Integer
End Type

Public Function clsfunc(foo() As my_type) As Integer
End Function

Compile error:

     Private Enum and user defined types cannot be
     used as parameters or return types for public
     procedures, public data members, or fields
     of public user defined types.

---
Fair enough.
********************************************************

mod1.bas

Public Type my_type
    Dim foo As Integer
End Type
Public my_array(100) As my_type

Sub modsub1()
    Call clsfunc(my_array)
End Sub

--

cls1.cls

Public Function clsfunc(foo() As my_type) as Integer
End Function

Compile error:

     Only public user defined types defined in public
     object modules can be used as parameters or return
     types for public procedures of class modules or as
     fields of public user defined types

---

My intention was that mod1.bas be a public object module.
I have not figured out what constitutes a public object
module into which I can put my public user-defined type.

Can somebody please help?  How can I pass a user-defined
type to a sub or function in a class object?

********************************************************

If I get a C/C++ error message that I do not understand,
it always comes with an error number.  I search that
number on an MSDN support disk and I usually find a
KB article or two that tells me more than I wanted to
know.

How could I search the MSDN disk for an error message
as the ones I received?
[+][-]06/29/03 04:57 PM, ID: 8823954Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]06/29/03 05:02 PM, ID: 8823966Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]06/29/03 08:55 PM, ID: 8824835Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]06/29/03 09:48 PM, ID: 8825079Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]06/30/03 03:07 AM, ID: 8826575Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]06/30/03 05:24 AM, ID: 8827065Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]06/30/03 05:34 AM, ID: 8827116Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]06/30/03 02:35 PM, ID: 8830766Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]07/01/03 01:00 AM, ID: 8832717Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]07/01/03 06:05 AM, ID: 8833732Accepted Solution

View this solution now by starting your 30-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

About this solution

Zones: Visual Basic Programming, Delphi Components
Tags: defined, object, public, types, passed
Sign Up Now!
Solution Provided By: JohnMcCann
Participating Experts: 5
Solution Grade: A
 
[+][-]07/01/03 07:53 PM, ID: 8836950Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]07/03/03 01:47 PM, ID: 8852650Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]07/05/03 08:33 PM, ID: 8862765Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
 
Loading Advertisement...
20091021-EE-VQP-81