在网页中如何读字典?
MxDraw网页开发|冯美娟|2018-11-21 14:26
-
回答:
function readVar(sName) { var database = mxOcx.GetDatabase(); var dict = database.GetNamedObjectsDictionary(); var myDict = dict.GetAt("MyExDataDictName"); if (myDict == null) { return ""; } var rec = myDict.GetAt(sName); if (rec == null) { return ""; } var ret = rec.GetXRecordData(); if (ret == null) return ""; return ret.AtString(0); } function read( sender, e) { var sRet = readVar("MyName"); if (sRet == "") { alert("没有数据"); } else { alert(sRet); } }