类似: "set obj = ##class(myClass).%OpenId(id)" 把一个id 赋予对象的实例,有没有办法可以通过提供类名和id 作为参数来实现功能/类方法来返回同样的结果,例如 用ObjectScript 中的getObjectInstanceByNameId(className As %String, id As %Integer)?谢谢!
*** Recovery started at Wed Sep 28 08:14:28 2022 Current default directory: d:\dhc\devsoftware\ensemble\mgr Log file directory: d:\dhc\devsoftware\ensemble\mgr\ WIJ file spec: d:\dhc\devsoftware\ensemble\mgr\CACHE.WIJ Recovering local (d:\dhc\devsoftware\ensemble\mgr\CACHE.WIJ) image journal file... Starting WIJ recovery for 'd:\dhc\devsoftware\ensemble\mgr\CACHE.WIJ'. 0 blocks pending in this WIJ. WIJ pass # is 0. Starting fast WIJ compare Finished comparing 24 blocks in 0 seconds Exiting with status 3 (Success)
ClassMethod TestArr()
{
s arrRow = [1,2,3,4,5,6,7]
s size = arrRow.%Size() - 1
for i = 0 : 1 : size {
s ii = (size / size) * i // 有size运算, 就报错
w arrRow.%Get(ii), !
}
q ""
}