You must use the value returned by this function

I have this public method named GetHoursWorked and a private property named mHoursWorked.

GetHoursWorked code:

Return mHoursWorked

I’m trying to get the value of mHoursWorked by calling the GetHoursWorked method but it displays an error you must use the value returned by this function

Hello,
assuming the mHoursWorked is of type Double you can do somewhere in your app:

dim hW as Double hW = GetHoursWorked

you had also set the return type in your method?
you can also use computed properties.

And to be complete, sometimes you do not need the returned value so you can use:

Call GetHoursWorked

but not in this case, I think :wink: