Results 1 to 4 of 4
  1. #1
    Join Date
    Mar 2009
    Location
    SLOVAKIA,Bratislava
    Posts
    70

    Lightbulb Unanswered: Public Variable to Property

    Hi i am moving my Public Variables to public Properties
    (Strings,Long,Variant,Objects,Classes,Single-Custom-Types...OK)
    but it seems
    - arrays (g_Array)
    - Multiple-Custom-Types (g_parFRM_KSX_DFT)
    are NOT supported...
    Code:
    Public g_Array(84) As String 
    Private Type type_FRM_KSX_DFT 
        varBrowseFields As Variant 
        varFreezeFields As Variant 
        eBestFit As eBrowseBestFit_Enum 
        nFontSize As Long 
        bNotEmpty As Boolean 
        eTTTW_ColXB0 As eTTTW_ColXB0_Enum 
        cOrderBy As String 
        bOrderByOn As Boolean 
    End Type 
    Public g_parFRM_KSX_DFT As type_FRM_KSX_DFT
    15 years db-programmer(dBase,FoxPro,MS Access 2002/2003),Symbian C++

  2. #2
    Join Date
    May 2005
    Posts
    1,191
    Quote Originally Posted by pacala_ba
    Hi i am moving my Public Variables to public Properties
    (Strings,Long,Variant,Objects,Classes,Single-Custom-Types...OK)
    but it seems
    - arrays (g_Array)
    - Multiple-Custom-Types (g_parFRM_KSX_DFT)
    are NOT supported...
    Code:
    Public g_Array(84) As String 
    Private Type type_FRM_KSX_DFT 
        varBrowseFields As Variant 
        varFreezeFields As Variant 
        eBestFit As eBrowseBestFit_Enum 
        nFontSize As Long 
        bNotEmpty As Boolean 
        eTTTW_ColXB0 As eTTTW_ColXB0_Enum 
        cOrderBy As String 
        bOrderByOn As Boolean 
    End Type 
    Public g_parFRM_KSX_DFT As type_FRM_KSX_DFT
    Is there a question in there? Or is that just an FYI?
    Me.Geek = True

  3. #3
    Join Date
    Mar 2009
    Location
    SLOVAKIA,Bratislava
    Posts
    70
    but it seems
    - arrays (g_Array)
    - Multiple-Custom-Types (g_parFRM_KSX_DFT)
    are NOT supported... is that TRUE or NOT ?
    15 years db-programmer(dBase,FoxPro,MS Access 2002/2003),Symbian C++

  4. #4
    Join Date
    Mar 2009
    Posts
    5,442
    Provided Answers: 14
    It's true: You cannot define a public user defined type or an array within an object module. Those should be moved to an independant module.

    However, the trick is to declare a Variant and to assign your udf or array to it.
    To simulate a public array into a class module, use a set of Property procedures that accept and return a variant containing an array.

    Have a nice day!

Posting Permissions

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