Hi there,
I’m getting a TypeMismatchException inconsistently with the following lines. I don’t suppose anyone has an idea as to why this exception only occurs SOME of the time? I should say, in this example, the dictEvent var is the same data every time (saved state from a player turn).
dim aIP as Auto = dictEvent.Value("InitialPositions")
dim dictIP() as xojo.Core.Dictionary = dictEvent.Value("InitialPositions")
It’s the second line that occasionally (why only occasionally?! argh!) throws a TypeMismatchException. If I exit and run the project again, it will happily assign dictIP() to dictEvent.Value(“InitialPositions”).
I attempted to try and handle the occasional exception with
[code] dim aIP() as Auto = dictEvent.Value(“InitialPositions”)
dim dictIP() as xojo.Core.Dictionary
for each d as xojo.Core.Dictionary in aIP
dictIP.Append(d)
next[/code]
In that case, aIP()=dictEvent.Value(“InitialPositions”) throws an exception. Bit lost as to why the exception isn’t occurring 100% of the time!
Oh yeah, should probably say, dictEvent.Value(“InitialPositions”) is most definitely an array of dictionaries.