複数のレベルでリンクをたどる DXL スクリプトを作成しています。モジュールが開いているときに、スクリプトがこれらのリンクを正しく反復処理することに気付きました。ただし、反復するモジュールが約 20 あり、これらすべてのモジュールを開きたくありません。リンクされたモジュールを手動で開かずにこれらのリンクを表示するにはどうすればよいですか?
これが私のコードの例です:
// Checks to see if the object exists or not. If not returns a null.
// This will be eventually adapted to make sure the object is from a
// specific set of modules, but for now we're just checking for ability
// to retrieve
Object getObject(Link obj_link) {
ModuleVersion other_ver = null
ModName_ other_mod = null
Object other_obj
other_ver = sourceVersion obj_link
other_mod = module(other_ver)
if (null other_mod || isDeleted other_mod) return null
other_obj = source obj_link
if (null other_obj) load(other_ver, true)
other_obj = source obj_link
if (isDeleted other_obj) return null
return other_obj
}
// Displays the object from a specific link module if it's found
void showOut(Object o) {
Link l_obj_link
string s = null
Item linkModItem = itemFromID(MODULE_ID)
string linkModName = fullName(linkModItem)
for l_obj_link in all(o <- linkModName) do {
Object test_obj
display("Test")
test_obj = getObject(l_obj_link)
if (null test_obj){
display("Null Object Found")
} else {
s = probeRichAttr_(test_obj, "Object Identifier", false)
displayRich(s)
}
}
}
// Call showOut for the object
showOut(obj)
繰り返しますが、これをレイアウト DXL スクリプトとして使用すると、リンクされたモジュールが開かれている場合にのみ、オブジェクト ID を確認できます。