Hi
I have a work around. It seems like you can pass the results of non-primitive function arg's via the arg's temselves as they appear to be arg's referenced not by value.
Is this correct?
I often wish to create a list or array with meta data fields using a function:
I may be barking up the wrong tree, there might be a way of achieving this that I haven't thought of
Best regards Rob
I have a work around. It seems like you can pass the results of non-primitive function arg's via the arg's temselves as they appear to be arg's referenced not by value.
Is this correct?
I often wish to create a list or array with meta data fields using a function:
Non primitive members of custom types:
Sub Class_Globals
Type win_t(numNaN As Int, numHighExceptions As Int, numLowExceptions As Int, avg As Double, w As List)
Private w As win_t ' window Buffer
End Sub
....
w = fillWindowDoAverage(dataBuffer, 0, nW)
....
'==========================================================================================
Private Sub fillWindowDoAverage(data() As Double, startIndex As Int, nwin As Int) As win_t
Dim listOut As win_t
Dim nNan As Int = 0
Dim val As Double
Dim avgAcc As Double = 0
listOut.Initialize
listOut.w.Initialize
If startIndex + nwin > data.Length - 1 Then
Return listOut
End If
For i = 0 To nwin - 1
val = data(i)
If IsNaN(val) = True Then
nNan = nNan + 1
Else
avgAcc = avgAcc + val
End If
listOut.w.Add(val)
Next
listOut.numNaN = nNan
listOut.avg = avgAcc / nNan
Return listOut
End Sub
I may be barking up the wrong tree, there might be a way of achieving this that I haven't thought of
Best regards Rob
Last edited: