精华内容
下载资源
问答
  • '****************************************************************************** '* File: name2comment.vbs '* Title: Name to Comment Conversion '* Model: Physical Data Model '* Objects: Table...
    '******************************************************************************
    '* File:     name2comment.vbs
    '* Title:    Name to Comment Conversion
    '* Model:    Physical Data Model
    '* Objects: Table, Column, View
    '* Author:   steveguoshao
    '* Created: 2013-11-29
    '* Mod By:   
    '* Modified: 
    '* Version: 1.0
    '* Memo:     Modify from name2code.vbs
    '******************************************************************************
    
    
    Option   Explicit 
    ValidationMode   =   True 
    InteractiveMode   =   im_Batch
    
    
    Dim   mdl   '   the   current   model
    
    
    '   get   the   current   active   model 
    Set   mdl   =   ActiveModel 
    If   (mdl   Is   Nothing)   Then 
          MsgBox   "There   is   no   current   Model " 
    ElseIf   Not   mdl.IsKindOf(PdPDM.cls_Model)   Then 
          MsgBox   "The   current   model   is   not   an   Physical   Data   model. " 
    Else 
          ProcessFolder   mdl 
    End   If
    
    
    '   This   routine   copy   name   into   comment   for   each   table,   each   column   and   each   view 
    '   of   the   current   folder 
    Private   sub   ProcessFolder(folder) 
          Dim   Tab   'running     table 
          for   each   Tab   in   folder.tables 
                if   not   tab.isShortcut   then 
                      tab.comment   =   tab.name 
                      Dim   col   '   running   column 
                      for   each   col   in   tab.columns 
                            col.comment=   col.name 
                      next 
                end   if 
          next
    
    
          Dim   view   'running   view 
          for   each   view   in   folder.Views 
                if   not   view.isShortcut   then 
                      view.comment   =   view.name 
                end   if 
          next
    
    
          '   go   into   the   sub-packages 
          Dim   f   '   running   folder 
          For   Each   f   In   folder.Packages 
                if   not   f.IsShortcut   then 
                      ProcessFolder   f 
                end   if 
          Next 
    end   sub
    
    
    展开全文
  • 1,默认注释列也没有的,你需要把要它开出来。找到一个“三角型加一支笔”的那个按扭点一下,你就明白怎么加了。Comment列哦。 2 PowerDesigner中批量根据对象的name生成comment的脚本 执行方法:Open ...

    1,默认注释列也没有的,你需要把要它开出来。找到一个“三角型加一支笔”的那个按扭点一下,你就明白怎么加了。Comment列哦。



    2   PowerDesigner中批量根据对象的name生成comment的脚本

    执行方法:Open PDM -- Tools -- Execute Commands -- Run Script
    ---------------------------------------------------执行以下
    Option Explicit
    ValidationMode = True
    InteractiveMode = im_Batch

    Dim mdl 'the current model

    'get the current active model
    Set mdl = ActiveModel
    If (mdl Is Nothing) Then
    MsgBox "There is no current Model"
    ElseIf Not mdl.IsKindOf(PdPDM.cls_Model) Then
    MsgBox "The current model is not an Physical Data model."
    Else
    ProcessFolder mdl
    End If

    'This routine copy name into code for each table, each column and each view
    'of the current folder
    Private sub ProcessFolder(folder)
    Dim Tab 'running table
    for each Tab in folder.tables
    if not tab.isShortcut then
    tab.comment = tab.name
    Dim col 'running column
    for each col in tab.columns
    col.comment= col.name
    next
    end if
    next

    Dim view 'running view
    for each view in folder.Views
    if not view.isShortcut then
    view.comment = view.name
    end if
    next

    'go into the sub-packages
    Dim f 'running folder
    For Each f In folder.Packages
    if not f.IsShortcut then
    ProcessFolder f
    end if
    Next
    end sub
    --------------------------------

    2   PowerDesigner中逆向工程将数据库中comment脚本赋值到PDM的name

    执行方法:Open PDM -- Tools -- Execute Commands -- Run Script
    ----------------------------------------------执行以下

    Option Explicit
    ValidationMode = True
    InteractiveMode = im_Batch

    Dim mdl 'the current model

    'get the current active model
    Set mdl = ActiveModel
    If (mdl Is Nothing) Then
    MsgBox "There is no current Model"
    ElseIf Not mdl.IsKindOf(PdPDM.cls_Model) Then
    MsgBox "The current model is not an Physical Data model."
    Else
    ProcessFolder mdl
    End If

    'This routine copy name into code for each table, each column and each view
    'of the current folder
    Private sub ProcessFolder(folder)

    Dim Tab 'running table
    for each Tab in folder.tables
    if not tab.isShortcut then
        if len(tab.comment) <> 0 then
             tab.name = tab.comment
        end if
        On Error Resume Next
        Dim col 'running column
        for each col in tab.columns
            if len(col.comment) <>0 then
                col.name =col.comment
             end if
            On Error Resume Next
       next
    end if
    next
    end sub

    展开全文
  • NULL 博文链接:https://zyy200411.iteye.com/blog/811504
  • powerDesigner 把name项添加到comment 使用方法使用方法 PowerDesigner->Tools->Execute Commands->Edit/Run Scripts 可以保存该脚本为:name2comment.vbs
  • 一、添加默认注释 1、新建一个TXT文档,将要添加的注释写在文档中 2、再将文档名改为:ActionTemplate.mst 3、将文件放到QTP安装目录(默认为:C:\Program Files\HP\QuickTest Professional)的dat文件夹中 在...

    一、添加默认注释

    1、新建一个TXT文档,将要添加的注释写在文档中

    2、再将文档名改为:ActionTemplate.mst

    3、将文件放到QTP安装目录(默认为:C:\Program Files\HP\QuickTest Professional)的dat文件夹中

     

    在文件中写入注释的内容如下:

    '**********************************************
    '作者:
    '创建时间:
    '更新人:
    '更新时间:
    '函数名称:
    '函数说明:
    '参数说明:
    '[1]
    '[2]
    '返回结果:
    '调用举例Call
    '**********************************************

    保存后,重新启动QTP,这样在脚本中每次创建的Action都会包含模板中的内容,省去了不少重复工作。

     

    二、调用外部vbs文件

    1、将通用函数写在一个vbs文件中,以供其他脚本调用
    2、调用外部VBS文件中的通用函数的方法(二选一即可),设置完后在QTP中直接使用函数名进行调用:
      1)通过在QTP中设置:file-->settings-->Resource-->“添加VBS文件的路径“
         
     
      2)在脚本中使用Executefile语句:Executefile "VBS文件路径"
      

     

    本事例程序代码:demo

    转载于:https://www.cnblogs.com/yangxia-test/p/3328254.html

    展开全文
  • PowerDesigner 中将Comment(注释)及Name(名称)内容互相COPY的VBS代码
  • VC下使用Macro (vbs)来实现标准函数注释的自动添加 仿VA

    转自FK之不做愤青

     Vc下面可以直接录制宏(Tools->Record quick Macros),这样可以把鼠标,键盘动作录制下来,录制以后可以编辑,(Tools->Macro,选中宏名称,点 EDIT 就可以进入宏文件中进行编辑)。默认的存储文件名是 MYMACRO.DSM,也可以直接打开编辑.   编辑代码是用vbs 写的,代码如下:

    '------------------------------------------------------------------------------
    'FILE DESCRIPTION: New Macro File
    '------------------------------------------------------------------------------

    Sub FunctionHead()
    'DESCRIPTION: 函数注释 标准格式
    'Begin Recording
    ActiveDocument.Selection.NewLine
     ActiveDocument.Selection = "//"
     ActiveDocument.Selection = "/*"
     for i=0 to 100
         ActiveDocument.Selection = "="
     next
     ActiveDocument.Selection.NewLine

     ActiveDocument.Selection = "//函数名:"
     ActiveDocument.Selection.NewLine
     ActiveDocument.Selection = "//作者:"
     ActiveDocument.Selection.NewLine
     ActiveDocument.Selection = "//日期:"
     ActiveDocument.Selection = Date 
     ActiveDocument.Selection = "  "
     ActiveDocument.Selection = Time
     ActiveDocument.Selection.NewLine
     ActiveDocument.Selection = "//功能:"
     ActiveDocument.Selection.NewLine
     ActiveDocument.Selection = "//输入参数:"
     ActiveDocument.Selection.NewLine
     ActiveDocument.Selection = "//返回值:"
     ActiveDocument.Selection.NewLine
     ActiveDocument.Selection = "//修改记录:"
     ActiveDocument.Selection.NewLine
     ActiveDocument.Selection = "//备注:"
    ActiveDocument.Selection.NewLine
     ActiveDocument.Selection = "//"
     for i=0 to 100
         ActiveDocument.Selection = "="
     next
      ActiveDocument.Selection = "*/" 
    ActiveDocument.Selection.NewLine
    'End Recording
    End Sub


    Sub FileHead()
    'DESCRIPTION: 文件注释 标准格式
    'Begin Recording
     ActiveDocument.Selection.NewLine
     ActiveDocument.Selection = "//"
     ActiveDocument.Selection = "/*"
     for i=0 to 100
         ActiveDocument.Selection = "="
     next
     ActiveDocument.Selection.NewLine
     ActiveDocument.Selection = "//文件名:" & ActiveDocument.Name
     ActiveDocument.Selection.NewLine
     ActiveDocument.Selection = "//作者:"
     ActiveDocument.Selection.NewLine
     ActiveDocument.Selection = "//日期:"
     ActiveDocument.Selection = Date   
     ActiveDocument.Selection = "  "
     ActiveDocument.Selection = Time
     ActiveDocument.Selection.NewLine
     ActiveDocument.Selection = "//功能:"
     ActiveDocument.Selection.NewLine
    ' ActiveDocument.Selection = "//输入参数:"
     'ActiveDocument.Selection.NewLine
    ' ActiveDocument.Selection = "//返回值:"
    ' ActiveDocument.Selection.NewLine
     ActiveDocument.Selection = "//修改记录:"
     ActiveDocument.Selection.NewLine
     ActiveDocument.Selection = "//备注:"
     ActiveDocument.Selection.NewLine
     ActiveDocument.Selection = "//"
     for i=0 to 100
         ActiveDocument.Selection = "="
     next
      ActiveDocument.Selection = "*/" 
      ActiveDocument.Selection.NewLine
    'End Recording
    End Sub

       在写完宏后,可以选择 Tools->Macro->Option ->Toolbats,把新制作的宏做成按钮显示,然后选择一个配套的icon,就可以在需要时直接加入注释了,很方便的哦,如果不够你还可以添加快捷键完全使用键盘操作。

    展开全文
  • Create_chn_From_Comment.vbs Option Explicit ValidationMode = True InteractiveMode = im_Batch Dim mdl 'the current model 'get the current active model Set mdl = ActiveModel If (m
  • vbs脚本

    2021-04-21 14:05:16
    1、注释 两种格式REM +内容或者’+内容 'REM 这是注释 ' Dim name:name = 2 ' const name2=33 ' Dim msg ' '这也是注释 ' 'nskdjkasj ' msg="shu" vbs内建函数。inputbox表示输入。msgbox表示输出 vbs的函数为一个...
  • vbs控制电脑说话,vbs获取时间,vbs小程序

    千次阅读 多人点赞 2018-12-19 10:01:58
    VBS也挺强大的呢,这篇给大家演示的是获取当前时刻,并根据不同的时间段来问好! 注:编辑器不支持vbs编程,单引号后是注释哦!
  • 在用PowerDesigner时.常常在NAME或Comment中写中文在Code中写英文.Name只会显示给我们看,Code会使用在代码中.但Comment中的文字会保存到数据库TABLE的Description中,有时候我们写好了Name再写一次...vbs"]'***...
  • Option Explicit ValidationMode = True InteractiveMode = im_Batch   Dim mdl 'the current model   'get the current active model Set mdl = ActiveModel ...If (mdl Is N
  • comment2name.vbs Option Explicit ValidationMode = True InteractiveMode = im_Batch Dim mdl ' the current model ' get the current active model Set mdl = ActiveModel If (mdl Is Nothing) Then ...
  • 我第一次接触这个东西,特别的迷茫不知道该从哪里入手希望大家能帮助帮助我
  • vbs病毒源文件

    2020-09-06 02:13:10
    小弟才接触vbs.前几天中了个病毒,我看了半天,看不明白。有些看明白的地方我做了注释。请大虾帮忙解加些注释,万分感激,病毒代码如下:
  • powerdesigner是个好东西,我对它很有感情,不过也有些不满,不满有三:1。采用ms技术,不能在linux等非windows平台上使用,脚本执行语言采用vbscript,建议采用javascript,python,perl等更大众的语言。...
  • 要是你想选择自己用vbs实现这个要求,需要弄清楚三个问题:1、怎么用vbs连接数据库2、怎么查询变量归档3、怎么用vbs操作控件第一个问题主要是写好连接字符串,可以看书或者在网上搜教程,很简单。第三个问题网上也有...

空空如也

空空如也

1 2 3 4 5 ... 12
收藏数 228
精华内容 91
关键字:

vbs注释