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首字母不变大小的手段
选项->校对—〉自动更正选项->“自动更正”页,句首字母大写,取消就行了
随机推荐
- nyoj237 游戏高手的烦恼(最小点覆盖)
题目237 题目信息 pid=237" style="text-decoration:none; color:rgb(55,119,188)">执行结果 本题排行 ...
- jquery 中attr和prop的区别
在jQuery API中也有专门解释: Attributes VS. Properties 在一些特殊的情况下,attributes和properties的区别非常大.在jQuery1.6之前,.at ...
- Scapy基础学习之中的一个
关于Scapy Scapy的是一个强大的交互式数据包处理程序(使用python编写). 它可以伪造或者解码大量的网络协议数据包,可以发送.捕捉.匹配请求和回复包等等.它可以非常easy地处理一些典型操 ...
- Android开发之Is Library篇
一.生活场景描述 由于公司有一个项目开发的时间比较长,项目里堆砌的代码也比较多,并且有些功能在给不同客户发布的时候有些功能还不需要,这样功能模块分离就很有必要了. 所以,Library就被推到了前台, ...
- 切换默认Activity和Fragment的动画
Activity中 public void click(View view){ Intent intent = new Intent(); intent.setClass(this, TwoActiv ...
- springboot学习(五) 全局异常处理
创建全局异常处理 /** * 全局异常配置管理 */ @ControllerAdvice public class GlobalExceptionConfig extends ResponseEnti ...
- MII_GMII_RGMII_RMII_SMII_SSMII_TBI_RTBI比较
MII_GMII_RGMII_RMII_SMII_SSMII_TBI_RTBI比较 https://wenku.baidu.com/view/2e136caa8bd63186bdebbc40.html
- java - day10 - uptest
package day03; public class UpTest { public static void main(){ Aoo o = new Aoo(); o.a = 3; o.b = 3; ...
- python基础-初识Python和不同语言之间的区别
一.Python的创始人谁? Python之父:吉多·范罗苏姆GuidovanRossum 吉多·范罗苏姆是一名荷兰计算机程序员,他作为Python程序设计语言的作者而为人们熟知.在Python社区, ...
- android 阿拉伯语下,图库中编辑运动轨迹图片,动画中会显示绿色的图片
alps/packages/apps/Camera/src/com/android/camera/FileSaver.java 1:import java.util.Locale; 2:modify ...