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);
}
{
#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);
}
{
#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);
}