zoukankan      html  css  js  c++  java
  • 在Powerdesigner中,根据已有字段的Name值替换Code相同的Name的值

    如果在powerdesigner中有一个表我已经把名子和你码对应好了.
    比如Name是年,Code是year,那么怎么把别的表中的Code是Year的Name设成年呢?
    用以下代码即可,哈哈.调好了.

    Dim nb
    nb=ActiveSelection.Count
    if nb=0 then
    Output "No selected Objects"
    end if
    dim obj
    Dim d                   '创建一个变量  and (not d.Exists(col.Code))
    Set d = CreateObject("Scripting.Dictionary")
    for Each obj in ActiveSelection
      for each col in obj.Columns
        if (col.Code<>col.Name) and (not d.Exists(col.Code))then
        Output "--"+obj.Name+"."+obj.Code+"="+col.Name+"."+col.Code
          d.Add col.Code,col.Name
         end if
      next
    next
    for Each obj in ActiveSelection
      for each col in obj.Columns 
        if (col.Code=col.Name) and (d.Exists(col.Code) )then
         Output col.Name+"."+col.Code+"."+d.Item(col.Code)
          col.Name=d.Item(col.Code)
         end if
      next
    next
    千人.NET交流群:18362376,因为有你,代码变得更简单,加群请输入cnblogs
  • 相关阅读:
    习题4.7利用vector实现数据复制
    习题4.18
    4.8编写一小段程序实现两vector是否相等的比较
    关于野指针
    学习c++的50条忠告
    c++头文件
    习题4.14
    容器和迭代器
    Android上C++对象的自动回收机制分析
    Windows下载Android源码
  • 原文地址:https://www.cnblogs.com/kingkoo/p/1283986.html
Copyright © 2011-2022 走看看