object VS unknown type

BlitzMax Forums/BlitzMax Programming/object VS unknown type

Hi,

That really should work.

I'll sort this out soon, but in the meantime you could just pass the modified array back, eg:


Function Append:Object[]( t:Object[],o:Object )
Local size:Int = Len(t)
t=t[..size+1]
t[size] = o
Return t
End Function

Type MyType
Field s:String
End Type

Global t:MyType[]
Global m:MyType

Print "Append firsttry:"+Chr(13)
m = New MyType
m.s = "firsttry"
t = MyType[]( Append(t,m) ) 'have to convert returned Object[] to MyType[].

Print t[0].s