SQL版本:2000

PowerDesigner版本:16

网上有不少介绍 PowerDesigner Name/Code自动调整 的文章,但基本如出一辙。

这里,我就介绍下如何根据输入的Name根据首字母自动生成Code的方法,这也是在实际应用中最常用的。根据默认设置,Code内容与Name一致,假如输入中文Name名称,Code自动生成的也是中文的,这不是我们想要的,往往我们以中文首字母作为Code。

下面就来介绍一下方法:

  1. 主菜单Tools->General Options->Dialog-> Name to Code mirroring,勾上(默认是勾上的)。
  2. 主菜单Tools->Model Options-> Naming Convention项(设置该项,会影响所有的子节点).勾选" Enable name/code conversions".

    然后在Name To Code标签页输入以下脚本即可.

    .vbscript(%Name%)
    ScriptResult=getpy(ScriptInputArray())
    function getpychar(char)
    tmp=+asc(char)
    if(tmp>= and tmp<=) then
    getpychar= "A"
    elseif(tmp>= and tmp<=) then
    getpychar= "B"
    elseif(tmp>= and tmp<=) then
    getpychar= "C"
    elseif(tmp>= and tmp<=) then
    getpychar= "D"
    elseif(tmp>= and tmp<=) then
    getpychar= "E"
    elseif(tmp>= and tmp<=) then
    getpychar= "F"
    elseif(tmp>= and tmp<=) then
    getpychar= "G"
    elseif(tmp>= and tmp<=) then
    getpychar= "H"
    elseif(tmp>= and tmp<=) then
    getpychar= "J"
    elseif(tmp>= and tmp<=) then
    getpychar= "K"
    elseif(tmp>= and tmp<=) then
    getpychar= "L"
    elseif(tmp>= and tmp<=) then
    getpychar= "M"
    elseif(tmp>= and tmp<=) then
    getpychar= "N"
    elseif(tmp>= and tmp<=) then
    getpychar= "O"
    elseif(tmp>= and tmp<=) then
    getpychar= "P"
    elseif(tmp>= and tmp<=) then
    getpychar= "Q"
    elseif(tmp>= and tmp<=) then
    getpychar= "R"
    elseif(tmp>= and tmp<=) then
    getpychar= "S"
    elseif(tmp>= and tmp<=) then
    getpychar= "T"
    elseif(tmp>= and tmp<=) then
    getpychar= "W"
    elseif(tmp>= and tmp<=) then
    getpychar= "X"
    elseif(tmp>= and tmp<=) then
    getpychar= "Y"
    elseif(tmp>= and tmp<=) then
    getpychar= "Z"
    else '如果不是中文,则不处理
    getpychar=char
    end if
    end function function getpy(str)
    for i= to len(str)
    getpy=getpy&getpychar(mid(str,i,))
    next
    end function
    .endvbscript

    脚本

    然后点击确定,设置完成。(如果想更改原来的设置,勾上Apply Name To Code Conversion->To All Objects即可,这样就会把所有对象的Code根据Name首字母重新生成。)

下面赶紧新建一列试试效果吧。

PowerDesigner之设置(3)——根据Name首字母生成Code的更多相关文章

  1. webapi时间字段返回格式设置及返回model首字母小写

    GlobalConfiguration.Configuration.Formatters.Remove(new XmlMediaTypeFormatter()); // 解决json序列化时的循环引用 ...

  2. 用友U8根据客户简称/供应商简称的拼音首字母生成助记码

    用友U8+中,客户档案和供应商档案可以设置自动生成助记码,但软件只能自动根据客户全称/供应商全称生成助记码,而无法选择按简称生成助记码,这显然十分不方便,可以通过如下方式解决: 修改步骤 1.往数据库 ...

  3. dedecms 栏目目录用首字母生成的方法

    修改dede/catalog.add.php文件 85行 $toptypedir = GetPinyin(stripslashes($toptypename)); 修改为 $toptypedir = ...

  4. text-transform设置单词首字母大写

    text-transform 一.语法   text-transform 主要用于设置文本的大小写. text-transform有5个值,分别如下: none. 默认值. capitalize. 文 ...

  5. Microsoft office word关闭英文输入首字母大写设置

    1.概述: 在使用office word的时,经常出现输入一段不需首字母大写的英文时,通常敲击完回车时word会自动将首字母大写,需要重新将首字母修改成小写,这样操作很不方便.于是需要对这个功能进行一 ...

  6. php 中文转拼音,可以只转首字母,可以设置utf8、gbk

    <?php class Pinyin { /** * 默认是gb编码,第二个参数随意设置即为utf8编 * @param type $isInitial 是否只返回首字母 * @return t ...

  7. android studio 首字母提示 设置 大小写敏感

    在使用Android studo 编写程序时, 刚开始,关键字提示 首字母 设置了 大小写敏感,小写字母只能提示小写字母开头的,大写字母只能提示大写字母开始的,比较麻烦,在网上搜了下,解决办法如下: ...

  8. QLabel设置伙伴关系和快捷键(Alt+首字母)

    Qlabe中设置伙伴关系是使用Setbuddy函数: Qlabel.Setbuddy(QLineEdit) #将Qlabel和QLineEdit之间设置伙伴关系 另外,需要配合热键(快捷键)进行使用, ...

  9. 设置office首字母不变大小的手段

    选项->校对—〉自动更正选项->“自动更正”页,句首字母大写,取消就行了

随机推荐

  1. Django——如何处理请求(URL配置和视图)

    URLconfig—— 为了绑定视图函数和URL,我们使用URLconf. URLconf 就像是 Django 所支撑网站的目录. 它的本质是 URL 模式以及要为该 URL 模式调用的视图函数之间 ...

  2. java 发送html邮件,苹果或者某些邮件客户端收到的内容为空白解决方案

    需要把网页标签中的双引号替换为  "  或者  \\\" 例如 <div id=\\\"container\\\" style=\\\"widt ...

  3. jquery遍历数组的方式

    1,for循环: var arr = new Array(13.5,3,4,5,6); for(var i=0;i<arr.length;i++){ arr[i] = arr[i]/2.0; } ...

  4. IOS 多播委托(GCDMulticastDelegate)

    原文:http://www.cnblogs.com/dagehaoshuang/p/4043264.html 在IOS中为了实现回调一般有如下几个方法: delegate 通知中心 block KVO ...

  5. 转用Jmeter测试RabbitMQ

    转自:https://blog.csdn.net/luozhuwang/article/details/62044872 1.下载AMQP插件 github上面有源码,可以通过ant+ivy在本地进行 ...

  6. RandomForest 调参

    在scikit-learn中,RandomForest的分类器是RandomForestClassifier,回归器是RandomForestRegressor,需要调参的参数包括两部分,第一部分是B ...

  7. gcc支持的标签

    #include <stdio.h> #include <time.h> int main(/*int argc, char const *argv[]*/) { void * ...

  8. Ionic学习笔记5_动态组件指令

    1. 模态对话框 : $ionicModal 模态对话框常用来供用户进行选择或编辑,在模态对话框关闭之前,其他 的用户交互行为被阻止 .操作模态对象返回结果,模态对象的方法提前定制. 三个步骤 1.声 ...

  9. 李洪强经典面试题41-iOS选择题

    1.及时聊天app不会采用的网络传输方式是 DA UDP B TCP C Http D FTP 2.下列技术不属于多线程的是 AA Block B NSThread C NSOperation D G ...

  10. spring boot中 使用http请求

    因为项目需求,需要两个系统之间进行通信,经过一番调研,决定使用http请求. 服务端没有什么好说的,本来就是使用web 页面进行访问的,所以spring boot启动后,controller层的接口就 ...