Been playing with reflection and looking to port some code over, but having issues with the following, not sure if I’m doing something wrong. It crashes trying to get the value of setting with a memory access error:
Monkey
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
Namespacemyconfig
#Import"<std>"
#Import"<reflection>"
Using std..
ClassConfig
FieldconfigValue1:Int=1000
FieldconfigValue2:Int=2000
FieldconfigValue3:Int=3000
Method PrintFields()
Localtype:=Typeof(Self)
Print type
ForLocalsetting:=Eachintype.GetDecls()
Ifsetting.Kind="Field"
Print"Setting:"+setting.Kind+" = "+Int(setting.Get(Null))'Crashes here