My OOP doesn't Work....
Results 1 to 2 of 2

Thread: My OOP doesn't Work....

  1. #1
    Senior Member
    Join Date
    May 2003
    Posts
    217

    My OOP doesn't Work....

    'Frm_Display
    Option Explicit
    Option Base 1

    Private mName(3) As CName
    Private Sub Form_Load()
    Dim x As Integer

    x = 3

    Set mName(1) = New CName
    Set mName(2) = New CName
    Set mName(3) = New CName

    With mName(1)
    .fname.FirstName = "Jackie"
    .lname.LastName = "Chan"
    End With

    mName(2).name.FirstName = "King"
    mName(2).name.LastName = "Kong"

    mName(x).name.FirstName = "Donny"
    mName(x).name.LastName = "Zorro"

    Print mName(1).ffnFullName
    Print mName(2).ffnFullName
    Print mName(3).ffnFullName
    End Sub

    ****************************************************
    'Class Modules
    'CName

    Option Explicit

    Private mName As fullname

    Public Property Get name() As fullname
    name = mName
    End Property

    Public Property Set name(ByVal Nm As fullname)
    mName = Nm
    End Property

    Public Function fname() As String
    fname = mName.FirstName
    End Function

    Public Function lname() As String
    lname = mName.LastName
    End Function

    Public Function ffnFullName()
    ffnFullName = fname & " " & lname
    End Function

    ******************************************
    'Module
    'mDefinedUserType

    Option Explicit

    Type fullname
    FirstName As String
    LastName As String
    End Type

    *********************************
    Please tell my the problem, I've it in afew way..... I can't recognize the problem

  2. #2
    AO French Antique News Whore
    Join Date
    Aug 2001
    Posts
    2,126
    This code
    Type fullname
    FirstName As String
    LastName As String
    End Type
    should be
    Type fullname
    FirstName As String * X
    LastName As String * X
    End Type
    Where X is maxinum len of the string.
    Private mName As fullname shold be Public mName As fullname

    I think that it! Good Luck!
    -Simon \"SDK\"

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

 Security News

     Patches

       Security Trends

         How-To

           Buying Guides