On Apr 24, 2006, at 2:45 PM, Alexander Bauza wrote:

You don't have to return anything

I mean:

Sub MyMeth (arr() as string)
        arr.Append "A"
        arr.Append "B"
        arr.Append "C"
End Sub

Calling the method

Dim Myarr() as string
MyMeth (Myarr)

now Myarr is:
Myarr(0) = "A"
Myarr(1) = "B"
Myarr(2) = "C"


But that's not his mechanism nor the question

And beware if you do what he wants (return an array) and forget to specify the return value

        function mymeth() as string()   
        end


        dim a() as string

        a = mymeth()

        if uBound(a) < 0 then
        end if

you WILL get a VERY weird error when you run this (if you don't just crash) A nilobjectexception ... but arrays are not objects and you can't even test it with

        if a is NIL then
                // do something because the array is NIL
        else
                // do something because the array is NOT NIL
        end if


Be very careful about returning arrays if you forget the return value


_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>

Reply via email to