Quantcast
Channel: VBForums
Viewing all articles
Browse latest Browse all 15762

VS 2019 Trouble with assigning the result of a function to a property

$
0
0
Hi, my issue is that I can't seem to be able to assign a function's return value to an instance of a Class of same type:

vb.net Code:
  1. Dim MTranslate_Z As Matrix3D = Matrix3D.Create_Scale(2, 2, 2)
  2.  
  3. For Each Vertex As PVector In PTriangle.Vertices
  4.     Dim unused As PVector = MTranslate_Z.MultiplyVector(Vertex)
  5.     Vertex = unused
  6. Next

More info on the above:

-PTriangle.Vertices is a property that returns an array of PVector objects.
-The "MultiplyVector" Function of the matrix returns a PVector object.

I want to assign the object returned by the function to each object looped trough in the array but it tells me "Unnecessary assignment of a value to Vertex"
I thought of making it a sub and directly change the PVector but I rather keep it as a function, how should I proceed ?
Is it in the PVector Class that I need to add something to allow this ?

Thanks in advance for the help !

Viewing all articles
Browse latest Browse all 15762

Trending Articles