zoukankan
html css js c++ java
获取AX数据字典
AX提供了很多反射类可以获取元数据信息,刚刚一个同事需要一个AX数据字典的列表,顺手写了一个,没啥技术含量,在这里做个备份,以便以后复制粘贴.
static
void
DataDictionary(Args _args)
{
#AOT
#define
.FileName(@"d:\DataDictionary.txt")
TextBuffer tb
=
new
TextBuffer();
TreeNode treeNode
=
TreeNode::findNode(#TablesPath);
DictTable dictTable;
DictField dictField;
int
i;
;
treeNode
=
treeNode.AOTfirstChild();
while
(treeNode)
{
dictTable
=
new
DictTable(tableName2Id(treeNode.AOTname()));
tb.appendText(dictTable.name()
+
'
'
+
dictTable.label());
tb.appendText(
'
\n
'
);
for
(i
=
1
;i
<=
dictTable.fieldCnt();i
++
)
{
dictField
=
new
DictField(dictTable.id(),dictTable.fieldCnt2Id(i));
tb.appendText(
'
'
+
dictField.name()
+
'
'
+
dictField.label());
tb.appendText(
'
\n
'
);
}
print treeNode.AOTname();
treeNode
=
treeNode.AOTnextSibling();
}
tb.toFile(#FileName);
}
当然也可以不用TreeNode,而用Dictionary得到表.
static
void
DataDictionary2(Args _args)
{
#AOT
#define
.FileName(@"d:\DataDictionary.txt")
TextBuffer tb
=
new
TextBuffer();
Dictionary dictionary
=
new
Dictionary();
DictTable dictTable;
DictField dictField;
int
i;
int
j;
;
for
( i
=
1
;i
<=
dictionary.tableCnt();i
++
)
{
dictTable
=
new
DictTable(dictionary.tableCnt2Id(i));
tb.appendText(dictTable.name()
+
'
'
+
dictTable.label());
tb.appendText(
'
\n
'
);
for
(j
=
1
;j
<=
dictTable.fieldCnt();j
++
)
{
dictField
=
new
DictField(dictTable.id(),dictTable.fieldCnt2Id(j));
tb.appendText(
'
'
+
dictField.name()
+
'
'
+
dictField.label());
tb.appendText(
'
\n
'
);
}
print dictTable.name();
//
treeNode = treeNode.AOTnextSibling();
}
tb.toFile(#FileName);
}
查看全文
相关阅读:
java占位符应用
【QuickHit项目实例】
【那些年关于java多态应用】
【那些年关于MyEclipse的快捷键大全】
那些年【深入.NET平台和C#编程】
关于《网络电视精灵》项目
VS2013常用快捷键
关于C#的继承结论
关于【项目经理评分】项目的代码分析
序列化和发序列化
原文地址:https://www.cnblogs.com/Farseer1215/p/981148.html
最新文章
iview table render 进阶(一)
[] !== [] is true
TypeError 之 Cannot convert undefined or null to object
大厂二面经典前端技术面试题
堆排序 Heap Sort
start() vs. run()
IT basic knowledge
BGP Basic Knowledge
Autonomous System
root用户无法修改文件权限(lsattr/chattr: i 和 a 属性含义)
热门文章
MySQL basics
key points & (QA) about RPKI
Python traps and pitfalls
tcpdump Demo
vim tabs
vim插件快捷键
父目录的权限对子目录有没有影响?[Linux]
Shell字符串操作
source $0 & bash $0
关于Java语言中那些修饰符
Copyright © 2011-2022 走看看