DXL编程,经过DOORS客户端中的DXL编辑窗口进行,DXL的帮助文档在文件的安装目录中能够查阅编程
获取一个对象的url:数组
Object o = current
string u =getURL(o)
print uide
获取模块的url:url
Module m = current
string u =getURL(m)
print uspa
获取对象的heading:对象
Object o = current
string n = o."Object Heading"
print n文档
打印对象的顺序编号,标题,内容,URL:get
Object o = current
string n = identifier o //此处为顺序编号,不存在1,1.1,1.2这种编号,如需输出分级编号须要用number(o) string
string h = o."Object Heading"
string r = getURL(o)
string t = o."Object Text"
if(t==null)
{
t="null"
}
print n
print "\n"
print h
print "\n"
print r
print "\n"
print t
print "\n"it
遍历模块中的需求对象,将需求的编号,标题,内容,URL写入相应模块名字的txt文件:
Object o //定义对象
int m = 0 //定义数组下标
Module u = current //定义模块
string shishi= "D:\\" u."Name" ".txt" //定义以模块名字存储文件
Stream out = write shishi //定义写入文件
string n[1000]={null} //定义需求的编号数组
string h[1000]={null} //定义需求的标题数组
string r[1000]={null} //定义需求的URL数组
string t[1000]={null} //定义需求的内容数组
string e //定义需求的总数变量
for o in current Module do //遍历当前模块中的全部对象
{
n[m] = number(o) //存入需求编号
h[m] = o."Object Heading" //存入需求标题
r[m] = getURL(o) //存入需求的URL
t[m] = o."Object Text" //存入需求的内容
e = identifier o //记录需求的数量
if(t[m]==null) //当需求内容为空时存入null
{
t[m]="null"
}
m++ //数组下标++
}
out<<e //文件第一行写入需求对象的总数
out<<"\n"
for(i=0;i<m;i++) //循环写入数组中的全部需求内容{out<<n[i] out<<"\n" out<<h[i] out<<"\n" out<<r[i] out<<"\n" out<<t[i] out<<"\n" }