Class property with parameters

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Rob Willaar

    #1

    Class property with parameters

    Hi All,

    Can't see a any info how to declare parameters on a class propery.
    clsPiece Test = new clsPiece("AA,BB ,CC,",',');

    MessageBox.Show (Test.Piece(2)) ;

    Thanx,

    Rob




  • Chris R. Timmons

    #2
    Re: Class property with parameters

    "Rob Willaar" <r.willaar@xs4a ll.nl> wrote in news:OcFMeWGNGH A.516@TK2MSFTNG P15.phx.gbl:
    [color=blue]
    > Hi All,
    >
    > Can't see a any info how to declare parameters on a class propery.
    > clsPiece Test = new clsPiece("AA,BB ,CC,",',');
    >
    > MessageBox.Show (Test.Piece(2)) ;
    >
    > Thanx,
    >
    > Rob[/color]

    Rob,

    It's called an indexer:

    http://msdn.microsoft.com/library/de...opertiespg.asp

    --
    Hope this helps.

    Chris.
    -------------
    C.R. Timmons Consulting, Inc.

    Comment

    • Rob Willaar

      #3
      Re: Class property with parameters

      Thanks Chris


      "Chris R. Timmons" <crtimmons@X_NO SPAM_Xcrtimmons inc.com> schreef in bericht
      news:Xns976ECCC CA6BF1crtimmons crtimmonsin@207 .46.248.16...[color=blue]
      > "Rob Willaar" <r.willaar@xs4a ll.nl> wrote in
      > news:OcFMeWGNGH A.516@TK2MSFTNG P15.phx.gbl:
      >[color=green]
      >> Hi All,
      >>
      >> Can't see a any info how to declare parameters on a class propery.
      >> clsPiece Test = new clsPiece("AA,BB ,CC,",',');
      >>
      >> MessageBox.Show (Test.Piece(2)) ;
      >>
      >> Thanx,
      >>
      >> Rob[/color]
      >
      > Rob,
      >
      > It's called an indexer:
      >
      > http://msdn.microsoft.com/library/de...opertiespg.asp
      >
      > --
      > Hope this helps.
      >
      > Chris.
      > -------------
      > C.R. Timmons Consulting, Inc.
      > http://www.crtimmonsinc.com/[/color]


      Comment

      Working...