This issue is known to us; Array2.create won't work right now because it references the 'based' array creation methods (which Silverlight does not support). I think the workaround is to avoid calling Array2.create, and instead call the .Net Array.CreateInstance method

[link:msdn.microsoft.com]

and I think you can cast the result back to an F# 2-D array type.

By on 1/12/2009 3:40 PM ()

Hi Brian, thanks a lot, I thought that would be the right track so I can do this

let hold2 = System.Array.CreateInstance(typeof<cell>, [|0;0|]);;

but I can't get the type I need again e.g.

let hold3 = hold2 :> cell[,]

any suggestions?

many thanks daniel

By on 1/14/2009 6:05 AM ()
1
2
3
4
type cell = C 
let hold2 = System.Array.CreateInstance(typeof<cell>, [|1;1|])
let hold3 = hold2 :?> cell[,] 
hold3.[0,0] <- C

It's a downcast, not an upcast, so you need ":?>" rather than ":>".

By on 1/14/2009 8:17 AM ()

ha, easy, when you know. many thanks!

By on 1/15/2009 9:36 AM ()
IntelliFactory Offices Copyright (c) 2011-2012 IntelliFactory. All rights reserved.
Home | Products | Consulting | Trainings | Blogs | Jobs | Contact Us | Terms of Use | Privacy Policy | Cookie Policy
Built with WebSharper