„public function schwerpunkt(feld() as fc_point) as fc_point“
klappt nicht
Du musst das Feld ByRef übergeben.
Option Explicit
Private Type fc\_point
x As Double
y As Double
End Type
Private Function schwerpunkt(ByRef feld() As fc\_point) As fc\_point
feld(0).x = feld(0).x + 1
schwerpunkt.x = feld(0).x
schwerpunkt.y = feld(0).y
End Function
Private Sub Command1\_Click()
Dim feld() As fc\_point
Dim SP As fc\_point
ReDim feld(0)
feld(0).x = 1
feld(0).y = 2
SP = schwerpunkt(feld)
Me.Caption = SP.x
End Sub