Class modules & coordinates???

Discussion in 'AutoCAD' started by Mark Dubbelaar, Aug 11, 2004.

  1. hi

    i'm just new to class modules, and i'm having a little trouble with declaring a variable to be and arrayed double (i think thats how you say it) ie private m_LowerLeft(0 to 2) as double, this part is fine, its just the let property thats causing the problem....
    do i have to create this as a seperate collection object or can you use it the same was as you would normally user the Get and Let properties for a variable???

    Private m_LowerLeft(0 to 2) as double

    Public Property Get LowerLeft(0 to 2) As Double
    LowerLeft = m_LowerLeft
    End Property

    Public Property Let LowerLeft(ByVal newValue(0 to 2) As Double)
    m_LowerLeft = newValue
    End Property

    any help would be great

    cheers

    mark
     
    Mark Dubbelaar, Aug 11, 2004
    #1
  2. hope this help you


    this is the class
    Private m_LowerLeft(0 To 2) As Double

    Public Property Get LowerLeft() As Variant
    Dim I As Integer, RESULT As Variant

    ReDim RESULT(UBound(m_LowerLeft))
    For I = LBound(m_LowerLeft) To UBound(m_LowerLeft)
    RESULT(I) = m_LowerLeft(I)
    Next I
    LowerLeft = RESULT
    End Property

    Public Property Let LowerLeft(newValue As Variant)
    Dim I As Integer
    For I = LBound(m_LowerLeft) To UBound(m_LowerLeft)
    m_LowerLeft(I) = newValue(I)
    Next I
    End Property


    this is a module with a macro
    Public Sub Proof()
    Dim m As New Clase1
    Dim a(0 To 2) As Double, I As Integer, b As Variant

    a(0) = 8#: a(1) = 9#: a(2) = 10#
    m.LowerLeft = a
    b = m.LowerLeft

    For I = LBound(b) To UBound(b)
    MsgBox (b(I))
    Next I
    End Sub

    declaring a variable to be and arrayed double (i think thats how you say it)
    ie private m_LowerLeft(0 to 2) as double, this part is fine, its just the
    let property thats causing the problem....
    the same was as you would normally user the Get and Let properties for a
    variable???
     
    Orlando Toral, Aug 11, 2004
    #2
Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.