【发布时间】:2020-11-02 18:41:53
【问题描述】:
我是 DXL 新手,我正在尝试使用 Module_X 中的布局 DXL 根据 Module_Y 中链接属性的值显示文本输出。
Module_X 有多个外链,其中一个是 Module_Y。我想从 Module_Y 中读取的属性称为 Version_number,是从“版本 1”到“版本 6”的一系列枚举。
如果链接版本大于版本 3,那么我想在 Module_X 中运行的布局 DXL 中输出一个“是”文本字符串。 Module_X 中的每个对象可能有多个链接的 version_number。 Module_X 和 Module_Y 之间总共有 5 跳。
我试图通过分析向导来显示链接的 version_number 属性,这是成功的。 但是我不确定如何处理“如果 version_number 的值包含 > Version_3”元素。 任何帮助表示赞赏,如果我需要稍微分解一下这个问题,请告诉我。
void showOut(Object o, int depth) {
Link l
LinkRef lr
ModName_ otherMod = null
Module linkMod = null
ModuleVersion otherVersion = null
Object othero
string disp = null
string s = null
string plain, plainDisp
int plainTextLen
int count
bool doneOne = false
string linkModName = "*"
for l in all(o->linkModName) do {
otherVersion = targetVersion l
otherMod = module(otherVersion)
if (null otherMod || isDeleted otherMod) continue
if (!equal(getItem otherMod, (itemFromID limitModules[depth-1]))) continue
if (versionString(otherVersion) != limitVersions[depth-1]) continue
othero = target l
if (null othero) {
load(otherVersion,false)
}
othero = target l
if (null othero) continue
if (isDeleted othero) continue
int oldLines = lines[depth-1]
adjustLines(depth, 4)
bool kick = (doneOne) && (lines[depth-1] == oldLines)
if (kick) {
lines[depth-1]++
if (depth == 4) displayRich("\\pard " " ")
}
if (depth < 4) {
showOut(othero, depth+1)
}
doneOne = true
if (depth == 4) {
s = probeRichAttr_(othero,"Version_number", false)
if (s == "")
displayRich("\\pard " " ")
else
displayRich("\\pard " s)
}
lines[depth-1] += 1
}
} showOut(obj,1)
【问题讨论】:
-
请发布分析向导生成的代码。这样就更容易指出需要的更改。
-
谢谢,已按照建议添加代码。
标签: ibm-doors