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



Well, seeing that "he" is me, I may as well ask some questions.

In order to simplify this for myself, here is what I wrote, which works:

function test() as string()

dim myArr() As String
 myArr=Array("0,1,2")
  Return myArr

end

and called by an action in a pushbutton:


  dim arr() as String

  arr=test()

  MsgBox Join(arr)


Now, Norman, AFA I can tell, your concern was the fact that if a value is not returned by test() it will lead to undocumented behavior, is that correct?

And, we are surely not really passing the array, but some type of pointer to the array?

If that is so, why would it cause so much trouble if no value is passed, or maybe I am missing something?






_______________________________________________
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