PowerDesigner之设置(3)——根据Name首字母生成Code
SQL版本:2000
PowerDesigner版本:16
网上有不少介绍 PowerDesigner Name/Code自动调整 的文章,但基本如出一辙。
这里,我就介绍下如何根据输入的Name根据首字母自动生成Code的方法,这也是在实际应用中最常用的。根据默认设置,Code内容与Name一致,假如输入中文Name名称,Code自动生成的也是中文的,这不是我们想要的,往往我们以中文首字母作为Code。
下面就来介绍一下方法:
- 主菜单Tools->General Options->Dialog-> Name to Code mirroring,勾上(默认是勾上的)。
- 主菜单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的更多相关文章
- webapi时间字段返回格式设置及返回model首字母小写
GlobalConfiguration.Configuration.Formatters.Remove(new XmlMediaTypeFormatter()); // 解决json序列化时的循环引用 ...
- 用友U8根据客户简称/供应商简称的拼音首字母生成助记码
用友U8+中,客户档案和供应商档案可以设置自动生成助记码,但软件只能自动根据客户全称/供应商全称生成助记码,而无法选择按简称生成助记码,这显然十分不方便,可以通过如下方式解决: 修改步骤 1.往数据库 ...
- dedecms 栏目目录用首字母生成的方法
修改dede/catalog.add.php文件 85行 $toptypedir = GetPinyin(stripslashes($toptypename)); 修改为 $toptypedir = ...
- text-transform设置单词首字母大写
text-transform 一.语法 text-transform 主要用于设置文本的大小写. text-transform有5个值,分别如下: none. 默认值. capitalize. 文 ...
- Microsoft office word关闭英文输入首字母大写设置
1.概述: 在使用office word的时,经常出现输入一段不需首字母大写的英文时,通常敲击完回车时word会自动将首字母大写,需要重新将首字母修改成小写,这样操作很不方便.于是需要对这个功能进行一 ...
- php 中文转拼音,可以只转首字母,可以设置utf8、gbk
<?php class Pinyin { /** * 默认是gb编码,第二个参数随意设置即为utf8编 * @param type $isInitial 是否只返回首字母 * @return t ...
- android studio 首字母提示 设置 大小写敏感
在使用Android studo 编写程序时, 刚开始,关键字提示 首字母 设置了 大小写敏感,小写字母只能提示小写字母开头的,大写字母只能提示大写字母开始的,比较麻烦,在网上搜了下,解决办法如下: ...
- QLabel设置伙伴关系和快捷键(Alt+首字母)
Qlabe中设置伙伴关系是使用Setbuddy函数: Qlabel.Setbuddy(QLineEdit) #将Qlabel和QLineEdit之间设置伙伴关系 另外,需要配合热键(快捷键)进行使用, ...
- 设置office首字母不变大小的手段
选项->校对—〉自动更正选项->“自动更正”页,句首字母大写,取消就行了
随机推荐
- Unity 提取游戏资源之ktx转换
http://blog.csdn.net/akof1314/article/details/38022263 从雨松的博文<Unity3D研究院之mac上从.ipa中提取unity3D游戏资源( ...
- JavaScript——中的prototype(原型)
JS中的prototype是JS中比较难理解的一个部分 本文基于下面几个知识点: 1 原型法设计模式 在.Net中可以使用clone()来实现原型法 原型法的主要思想是,现在有1个类A,我想要创建一个 ...
- Linux——Ubuntu下Sublime Text 2的安装
Sublime Text 2是一款共享软件,收费但可以永久免费试用的编辑器,价格是59个美刀,相信开发者一定不了解中国人,也不面对中国市场,.言归正传,ST2编辑功能强大,好评如潮,在Windows/ ...
- Activity设置切换动画时黑屏问题的解决
//当这么设置的时候.打开Acticity的时候会黑屏一下 overridePendingTransition(R.anim.activity_open,0); //改成例如以下代码 完美解决这个问题 ...
- Python爬取豆瓣《复仇者联盟3》评论并生成乖萌的格鲁特
代码地址如下:http://www.demodashi.com/demo/13257.html 1. 需求说明 本项目基于Python爬虫,爬取豆瓣电影上关于复仇者联盟3的所有影评,并保存至本地文件. ...
- SDUTOJ 2775 小P的故事——奇妙的饭卡
watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvUl9NaXNheWE=/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA ...
- ssl中间证书
中间证书,其实也叫中间CA(中间证书颁发机构,Intermediate certificate authority, Intermedia CA),对应的是根证书颁发机构(Root certifica ...
- Eclips中文版或汉化使用
Eclipse简体中文包下载地址 :http://babel.eclipse.org/babel/ 在上面网站找,下载地址应该是(注意对应的版本): http://www.eclipse.org/do ...
- Timer和ScheduledExecutorService区别
Timer特点: 1.一个Timer只占用一个线程 timer有多个timerTask的情况,如果一个timerTask有执行时间过长,其它的timerTask就会被耽误 2.如果TimerTas ...
- printf不支持%lf
#include <stdio.h> int square137(int n); void p137() { double x = 3.0; int y = (int)x; printf( ...