.net - ConvertAll fails with NullReferenceException -


i trying flatten multi-dimensional array convertall can't work:

 private function flatten(byref object) object     dim elements integer = 0     dim size integer     r = 0 a.rank - 1         size = a.getupperbound(r) - a.getlowerbound(r) + 1         if elements = 0             elements = size         else             elements = elements * size         end if     next     dim result(elements - 1) object     ' fails !     result = a.convertall(a, new converter(of object, object)(function(x) x))     return result end function  sub main()     dim a(,) integer = {{1, 2, 3}, {4, 5, 6}}     dim b(5) integer     b = flatten(a) end sub 

why throw nullreferenceexception?

thanks

according msdn documentation, array.convertall() takes 0 based one-dimensional array tinput. have a(,) defined 2 dimensional


Comments

Popular posts from this blog

linux - Using a Cron Job to check if my mod_wsgi / apache server is running and restart -

actionscript 3 - TweenLite does not work with object -

jQuery Ajax Render Fragments OR Whole Page -