help with error with Visual Basic

1

I am doing a program in console more than anything for fun and I get the following error:

  

Property access must be assigned to the property or use its value.

This is where I get the error:

  

character.arma (5)

The class code is:

Class persona

    Private vida, daño As Integer
    Private nombre As String

    Public Property arma As Integer
        Get
            Return daño
        End Get
        Set(ByVal puño As Integer)
            daño = puño
        End Set
    End Property

    Public ReadOnly Property barra As Integer
        Get
            Return vida
        End Get
    End Property

    Public Sub aumento(ByVal subida As Integer)
        vida = vida + subida
    End Sub

End Class
    
asked by Jose Francisco Murga 19.05.2017 в 23:01
source

1 answer

1

Place your class persona as published:

Public class persona

...

End Class

and correctly define the value to the property, this is the error:

personaje.arma(5)

should be:

personaje.arma = 5 
    
answered by 19.05.2017 / 23:16
source