?
Solved

Urgent!!  Problem with class module

Posted on 2006-03-20
1
Medium Priority
?
172 Views
Last Modified: 2010-04-07
Ok here is what I'm trying to do....this is code I wrote in vb.net

    Public Class RateTier
        Public MinimumLTV As Decimal
        Public MaximumLTV As Decimal
        Public MinimumLoanAmount As Decimal
        Public MaximumLoanAmount As Decimal
        Public Fee As Decimal
        Public Rate As Decimal
        Public Apr As Decimal
        Public Margin As Decimal
        Public IndexValue As Decimal
        Public Points As Decimal
    End Class

    Public Class RateProduct
        Public Code As String
        Public Title As String
        Public LoanType As String
        Public Tiers As RateTier()
    End Class

    Public Class RateState
        Public Products() As RateProduct
        Public Abbreviation As String
        Public Label As String
        Public LoanType As String
    End Class

    Public Class RateSystem
        Public States As RateState()
    End Class

    Public Class Rates
        Public EffectiveDate As Date
        Public PrimeRate As Double
        Public Systems() As RateSystem
    End Class

So what this allows me to do is have multiple RateSystem under Rates multiple RateState under RateSystem etc.

So essentially if I wanted to access the property for abbreviation for the first system and first state I would do

Rates.RateSystem(0).RateState(0).Abbreviation

If I wanted to access the property for abbreviation for the second system 10th state I would do

Rates.RateSystem(1).RateState(9).Abbreviation

and so on...

How do I do something like this in just plain ol' vb6?  
0
Comment
Question by:BofADev
1 Comment
 
LVL 52

Accepted Solution

by:
Carl Tawn earned 2000 total points
ID: 16239936
Essentially replace you arrays with collections and expose them through properties in your classes:

i.e.

  '// Rates class

  Private rateSystem As Collection

  Public EffectiveDate As Date
  Public PrimeRate As Double
 
  Public Property Get RateSystem
    RateSystem = rateSystem
  End Property


Hope that made sense.
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Suggested Courses
Course of the Month8 days, 7 hours left to enroll

615 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question