• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 218
  • Last Modified:

Creating a parameterized read-write property

I would like help creating a parameterized read-write property named CarrierName. I would like it to accept one argument the AircraftID, and read or write the CarrierName property for the correct AircraftID. I'm having a problem in using the AircraftID argument.

Private msngCarrierName As String
Public property CarrierName( ) as String
       Get
              Return msngCarrierName
        End Get
        Set  (ByVal Value As String)
              CarrierName = value

               



                                             
0
augie0216
Asked:
augie0216
1 Solution
 
DabasCommented:
Hi augie0216:
>         Set  (ByVal Value As String)
>               CarrierName = value

Should be
        Set  (ByVal Value As String)
              msngCarrierName = value
        End set
Dabas
0
 
ptakjaCommented:
Simply add the argument:

Private msngCarrierName As String
Public property CarrierName(ByVal AirCraftID As Integer) as String
       Get
             ' Use AirCraftID in here
              Return msngCarrierName
        End Get
        Set  (ByVal Value As String)
              ' Use AirCraftID in here
              msngCarrierName = value
        End Set
End Property
0

Featured Post

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now