DXL 根据链接属性的条件显示单词

DXL to display a word based on the condition of a linked attribute

我是 DXL 新手,我正在尝试在 Module_X 中使用布局 DXL,以根据 Module_Y 中链接属性的值显示文本输出。

Module_X 有多个外链,其中之一是 Module_Y。我想从 Module_Y 中读取的属性称为 Version_number 并且是从“版本 1”到“版本 6”的一系列枚举。

如果链接版本大于版本 3,那么我想在布局 DXL 中输出一个 'Yes' 文本字符串,这个 运行 在 Module_X 中。 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)

    s = probeRichAttr_(othero,"Version_number", false)

    if (s == "") 
    displayRich("\pard " " ")
    elseif(intOf(s[8])>3)
    displayRich("\pard " s)

感谢您的意见。最后,碰巧的是,'link only' 部分由于任务的变化而变得不相关,因此这段代码起到了一定的作用。

非常感谢:-)