Results 1 to 6 of 6

Thread: classes

  1. #1

    Thread Starter
    PowerPoster
    Join Date
    Feb 2001
    Location
    Crossroads
    Posts
    3,046

    classes

    VB won't let me do this in a class module:

    Public MyVar() as double

    Error message says that an array is not allowed here

    I need to be able to have a class of the form:

    MyClass.MyVar(x)


    Is there anyway to do this?

    Thanks for any help!

  2. #2

    Thread Starter
    PowerPoster
    Join Date
    Feb 2001
    Location
    Crossroads
    Posts
    3,046
    anyone know how I can accomplish this using Property Procedures??

    Thanks for any help

  3. #3
    Hyperactive Member GlenW's Avatar
    Join Date
    Nov 2001
    Location
    Gateshead, England
    Posts
    479
    Will it allow

    Private MyVar() as double

    ?

  4. #4

    Thread Starter
    PowerPoster
    Join Date
    Feb 2001
    Location
    Crossroads
    Posts
    3,046

    yes, but .....

    Originally posted by GlenW
    Will it allow

    Private MyVar() as double

    ?
    Thanks for the response. It will allow Private, but I need access to the array outside the class module, so this won't help in my case.

  5. #5
    AIS_DK
    Guest
    [VBVCODE]
    Private MyVar() as double

    public property get Value(byval Index as long) as double
    Value= MyVar(Index)
    End property
    [/Highlight]

    That should do it

  6. #6
    Hyperactive Member GlenW's Avatar
    Join Date
    Nov 2001
    Location
    Gateshead, England
    Posts
    479
    If you include Get and Let procedures within your class
    they can allow access to the array.

Posting Permissions

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



Click Here to Expand Forum to Full Width