source insight中快速添加时间到代码

本文章中程序由其他网友代码修改而来, 并非原本原创,总结如下,作为个人笔记使用。

(1)打开工程base,打开文件Utils.em,插入以下代码:

//插入时间
macro MonthToName(MonthNum)

{
    if (MonthNum== 1)
	 return "01"

    if (MonthNum== 2)
        return "02"

    if (MonthNum== 3)
        return "03"

    if (MonthNum== 4)
        return "04"

    if (MonthNum== 5)
        return "05"

    if (MonthNum== 6)
        return "06"

    if (MonthNum== 7)
        return "07"

    if (MonthNum== 8)
        return "08"

    if (MonthNum== 9)
        return "09"

    if (MonthNum== 10)
        return "10"

    if (MonthNum== 11)
        return "11"

    if (MonthNum== 12)
        return "12"

}

macro DisplayDate()

{

    szTime = GetSysTime(1)

    Day = szTime.Day

    Month = szTime.Month

    Year = szTime.Year

    Hour = szTime.Hour

    Minute = szTime.Minute

    Second = szTime.Second

    if (Day < 10)

        szDay = "[email protected]@"

    else

        szDay = Day

    szMonth = MonthToName(Month)

    hbuf = GetCurrentBuf()

    SetBufSelText(hbuf, "/*  @[email protected]/@[email protected]/@[email protected]@[email protected]:@[email protected]:@[email protected]  */")

}

(2)分配快捷键:

Options->Menu Assignments 打开Menu Assignments窗口, 在Command中输入Macro, 选中要使用的宏(DisplayDate), 添加到合适的菜单中.还可以自定义快捷键,就可以了,我定义的是Ctrl+Alt+F11。

(选项-->键分配)

就可以产生以下效果:

/*  2014/09/28--11:41:15  */
时间: 2024-08-11 01:06:05

source insight中快速添加时间到代码的相关文章

Source Insight 中使用 AStyle 代码格式工具

Source Insight 中使用 AStyle 代码格式工具 彭会锋 2015-05-19 23:26:32     Source Insight是较好的代码阅读和编辑工具,不过source insight没有集成代码格式化工具:GNU的astyle是一个较好的免费的代码格式化工具,经过它的格式化之后,代码排版会变得很漂亮:Astyle主要作为插件供其他程序调用,具体的使用方法如下: 1 astyle下载地址: http://sourceforge.net/projects/astyle/

友坚4412开发板怎样在source insight中使汇编代码高亮显示?

友坚4412开发板怎样在source insight中使汇编代码高亮显示?4412开发板 做ARM嵌入式开发时,有时得整汇编代码,但在SIS里建立PROJECT并ADD TREE的时候,根据默认设置并不会把该TREE里面所有汇编文件都包含进来,默认只加了.inc和.asm后缀的, .s后缀的没有.而且用SIS打开.s的文件时,一片黑白没有色彩, 感觉回到DOS的EDIT时代里了. 解决方法是在Options->Document Options里面,点左上的Document Type下拉菜单,选择

source insight 中添加指定类型文件

source insight 中过滤某些格式的文件. 建立source insight工程后,先暂时不要急于添加文件. 打开options->document options,在document type中选择我们不需要的文件格式点击remove type 将其删除. 然后点击Close,至此我们可以放心添加文件了. 点击project ->add and remove project Files. 选中要添加的文件目录,点击Add Tree..简单方面.source insight 将自动递

在source insight中集成astyle

转自:http://www.cnblogs.com/xuxm2007/archive/2013/04/06/3002390.html 好吧,我有代码格式的强迫症,代码不整齐,我看的都头疼,之前一直喜欢用SourceStyler C++的,但是这个在win7下貌似不能使用,只能转向astyle了. http://www.cnblogs.com/xuxm2007/archive/2010/09/21/1832686.html 关于参数的话,差不过够用就行,不用非得调的那么精细,比较重要的是要看代码啊

Source Insight 中的 Auto Indenting

编码过程中,希望输入花括号时能自动对齐,Source Insigth 应如何设置? 先来看一下Source Insight 中的帮助. “ Auto Indenting The auto-indenting feature controls the level of indentation as you type new text. Source Insight supports Simple and Smart types of auto-indentation. Not all langua

Source Insight中的多行注释

我们经常要对一整段代码进行注释,很多代码编辑器都提供了这样的功能:用快捷键"Ctrl + /"来实现"//"的多行注释. 但是在用source insight的时候,发现竟然没有这样的功能.于是在网上搜了一下,sourceinsight里面的多行注释可以用宏来实现. 以下是实现多行注释的宏代码(在别的网站copy过来的,经过测试,还是很好用的): macro MultiLineComment() { hwnd = GetCurrentWnd() selection

ubuntu14.04中 gedit 注释能显示中文,而source insight中显示为乱码的解决办法

1.乱码显示情况: 2.用gedit打开文件,并用ctrl+shift+s(另存为),其中charactor coding选为chinese simplified(GB2312); 2.修改个文件名, 并点击save. 3.用source insight打开,看看是不是不是乱码了? - - 4.这个我可搞了好几天,嘿嘿~~~

在source insight中添加多行注释和快速添加#if 0的方法

1,添加函数 project->open project中打开Base,在utils.em文件中添加:MultiLineComment和AddMacroComment函数 macro MultiLineComment() { hwnd = GetCurrentWnd() selection = GetWndSel(hwnd) LnFirst =GetWndSelLnFirst(hwnd)      //取首行行号 LnLast =GetWndSelLnLast(hwnd)      //取末行行

在visual studio中快速添加代码段

昨天我在网课上,看到老师输入#2之后,立马就出现了一堆代码. 我于是赶紧打开自己的visual studio尝试一下,并没有任何反应. 上网查找,发现visual studio有自定义代码段的功能. —————————————————————————————————————————————————————— 一.参考链接 1.创建代码片段 2.代码片段架构参考 二.具体步骤 1.概述 创建自定义代码段包括这几个步骤: 创建一个 XML 文件,填写适当的元素,并向其中添加代码. 将这段代码导入代码