[Gambas-user] Recursion does not work
Benoît Minisini
gambas at ...1...
Thu Jan 21 16:39:16 CET 2010
> i found that
>
> Also, the contents of object
> <http://gambasdoc.org/help/def/object?view>datatypes (array types,
> collections, objects) are always passed by reference
> in both languages!
> from http://gambasdoc.org/help/doc/diffvb?view
>
> i think this is the problem!
>
> How to pass an Array byval in a function?
>
> i want to write something like that
>
> Private Function anag(ByVal iStart As Integer, ByVal iLen As Integer, ByVal
> sArray As Variant) 'VB5
>
> PRIVATE FUNCTION anag(iStart AS Integer, iLen AS Integer, sArray AS Array)
> 'Gambas
>
> ?
>
Objects are always passed by reference, as what is passed by value is the
reference.
You must declare your array argument as a String[], and use the Copy() method
before sending the array recursively.
Regards,
--
Benoît Minisini
More information about the User
mailing list