0
結構的名字,我想用一個字符串創建一個動態結構的名字,這是我的結構:動態創建在vb.net
Structure foo
dim lorem as string
dim ipsum as string
dim dolor as integer
dim sit as integer
End structure
在創作
dim bar as new foo 'Bar is temporary, it holds the information and then change its name [I know that's not working like that, imagine] (See below)
bar.lorem = "Random string here"
bar.ipsum = "But random doesn't exist, right ?"
bar.dolor = 42
bar.sit = 1337
bar.name = "Foobar_" & var 'integer/string/variable here (lets say var is "Cookie")
所以,當我想使用結構,我可以做這樣的事情:
msgbox("Secret cookie code =D >> " & callFunctionThatGetsStructureByName("Foobar_Cookie").sit.tostring)
我得到callFunctionBlahblah.sit - > 1337
這可能嗎?我希望我的解釋清楚。如果我能得到任何幫助,謝謝:)
聽起來像你只是想要一個鍵和你的結構字典。 – vcsjones 2014-11-20 18:47:12
我要去尋找那個,謝謝,我會發布,如果我得到消息 – Riptide 2014-11-20 18:50:33