Hello F# users!
Following the automation examples in the F# source, i created a wrapper for the Bloomberg COM interface (tlbimp.exe). I managed to figure out how to call the appropriate function call but i am having a hard time figuring out how to extract the data into a suitable generic structure for manipulation. Here is a simple example:
> #r "BLP_DATA_CTRLLib.dll";;
--> Referenced 'm:\research\fs_src\bi\BLP_DATA_CTRLLib.dll'
> open BLP_DATA_CTRLLib ;;
> let blp = new BlpDataClass() ;;
val blp : BlpDataClass
Binding session to 'm:\research\fs_src\bi\BLP_DATA_CTRLLib.dll'...
> blp.BLPSubscribe ;;
val it : ('a * 'b -> obj) = <fun:it@4>
> let p = blp.BLPSubscribe("IBM US Equity", "PX_LAST") ;;
val p : obj
>p;;
val it : obj = [|[|127.98|]|]
> let price : float array array = (unbox p) ;;
val price : float array array
System.InvalidCastException: Unable to cast object of type 'System.Object[,]' to type 'System.Double[][]'.
at <StartupCode$FSI_0007>.$FSI_0007._main()
stopped due to error
i have tried various forms of unbox, but none seems to do the trick. What am i missing?
thanks for your help.