ReneMiner
24-01-2015, 10:12
i want to know something :D
see the small example:
Uses "console"
Function fTest( ByRef a(), ByVal newDims As Long ) As Long
' this function shall redim some array a and return new ubound
ReDim Preserve a(newDims)
Function = UBound(a)
End Function
Dim foo() As Long ' the real, global array
PrintL Str$( fTest( foo, 123) )
PrintL "now:" & UBound(foo) ' i want it to print 123 too :(
WaitKey
thinBasic itself has a few functions that can do this as Dir_ListArray or Parse - where the passed variable to redim is mandatory a string.
But is it possible from script-side to do similar and redim any array passed by user like that?
Any ideas- hints?
see the small example:
Uses "console"
Function fTest( ByRef a(), ByVal newDims As Long ) As Long
' this function shall redim some array a and return new ubound
ReDim Preserve a(newDims)
Function = UBound(a)
End Function
Dim foo() As Long ' the real, global array
PrintL Str$( fTest( foo, 123) )
PrintL "now:" & UBound(foo) ' i want it to print 123 too :(
WaitKey
thinBasic itself has a few functions that can do this as Dir_ListArray or Parse - where the passed variable to redim is mandatory a string.
But is it possible from script-side to do similar and redim any array passed by user like that?
Any ideas- hints?