我正在尝试动态创建对象和/或属性...这可能吗?
CLIENT_INFO
NAME
F_NAME (= "LoriBeth")
L_NAME (= "Johnson")
ADDRESS
ADDY1 (= "123 MyStreet")
ETC (= "Etc")
在哪里:
Dim objCreated as Object
Dim objName AS String = "CLIENT_INFO"
Dim 1stProp as String = "NAME"
etc...
objCreated = makeObject(objName, objProp1, etc...)
Function makeObject(byval objName as String, byval objProp1 as String, etc...)
Class &objName
Property &objProp1
End Property
End Class
Return &objName
End Function
(我使用 VFP 方式在运行时将 vars 替换为它们的值)
最终得到一个可寻址的对象,例如:
CLIENT_INFO.NAME.F_NAME = "LoriBeth"