c++builder编译器使用技巧大收集!
曾经有一个人跟我说过,一个合格的软件开发人员,必须至少满足以下三点:
1.熟练的一门以上开发语言。
2.熟知软件工程相关的知识。
3.熟练一个软件开发平台。
第一条是我们一般讨论最多的,这里就不做更多说明了。第二条是需要一定的经验积累的,我们暂且不谈。第三条是往往被忽视的。
我想问问各位,各位对自己所用的c++builder环境的熟悉程度能够达到多少?80%的功能都熟悉?70%?60%?开发环境的熟悉程度,直接影响着我们软件的制作效率。
----------以上全是废话,呵呵,见谅!
所谓集思广益,我希望在这个帖子里,大家都能将自己觉得比较有用的编译器使用技巧(不是语言技巧)拿出来分享给其他人,让我们的效率得到共同的提高!鼓掌!哈哈!
格式:
开发环境:.......
技巧名称:.......
具体步骤:
在这里我先抛砖引玉,献丑了:
技巧1:
开发环境:bcb5.0、bcb6.0(bcb其他版本没用过,貌似也可以)
技巧名称:模板式代码。
具体步骤:
1.在编译器中点Tools->Editor Options->Code Insight->Code templates
2.点击Add,在Shortcut Name中加入“//todo:”,在Description中加入“重点标记”
3.在code中加入“//todo:”,点击ok
4.回到代码编辑器中,按下Ctrl+j,会出现一个提示框,它将先前所添加的所有模板代码都提供出来,以供选择,然后从中找到名为“重点标记”的那行(一般就是第一行),回车,//todo:就自动添加到光标位置,和平时使用对象的方法属性一样方便,是不是很好?(在这里简单废话一下,//todo:的用法是可以在View->To-Do List中通过双击鼠标自动定位到含有//todo:的行,方便下次打开文档时直接定位,相当于书签的效果。)
这里不仅可以将注释作为模板添加,还可以加入代码,比如代码:
for (int i = 0; i < ; i++)
{
}
的使用频率很高,我就可以将它加入模板中使用。
技巧2:
开发环境:bcb5.0、bcb6.0(bcb其他版本没用过,貌似也可以)
技巧名称:删除多余链接。
具体步骤:
在修改别人的软件时,或者自己想用高版本编译器打开低版本编译器编写的软件时,在编译时常常会出现LINKER .....lib错误。这个错误就是由于在先前工程中遗留了一些三方控件的链接造成的。这里我以WinSkinC5.lib为例讲解:
我以前的程序是用bcb5.0编写的,其中也用到一些第三方控件,比如WinSkinC5就是皮肤控件,但是如果我将编译器升级为bcb6.0时,编译就出现了连接错误LINKER WinSkinC5.lib(具体报错名称我不记得了,反正就是链接错误)。看到这个错误后我们往往会想到代码中有什么错误,看了半天也没有发现,改删除的都删除了,就是链接不了。不用急,首先打开Project->Edit Option Source。就会打开一个xml文件。这个文件记录了工程中的所有配置。从LIBRARIES value=和SPARELIBS value=中删除WinSkinC5.lib,保存,然后在Project->Options中随便修改一个东西,保存,再改回来。File->Close All,然后重新打开工程,编译,LINKER WinSkinC5.lib错误不复存在了。
技巧3:
开发环境:bcb5.0、bcb6.0(bcb其他版本没用过,貌似也可以)
技巧名称:关闭自动升级。
具体步骤:
在编译器中点Tools->Environment Options->C++Builder Direct,将Automatically Poll network取消,这样可以免得常常出现自动升级的提示框,据说也是盗版防止被查的方法。
技巧4:
开发环境:bcb5.0、bcb6.0(bcb其他版本没用过,貌似也可以)
技巧名称:脱离环境运行。
具体步骤:
1.project->Options->Compiler中点击Release
2.project->Options->Packages中取消Builder with runtime packages的对钩
3.project->Options->Linker中取消Use dynamic RTL前的对钩
3、4两条是小儿科,纯粹凑数,别打我,呵呵!(也可能有新手不知道嘛!)
顺便问一下:在使用对象+ ->时,编译器会出现一个提示框,里面有很多属性、方法、事件或者是整型、布尔型、浮点型、字符串型等,但是十分凌乱,显示没有规律。请问,当我想只看该对象的所有属性,或者只看整型返回值,或者只看浮点型返回值时,该如何操作,能否将提示框内同类型的提取出来,或者排在最前面?这样我在使用一个新控件时就不必花很多时间去找自己所要的属性、方法等。
下面大家也将自己的使用技巧心得拿出来分享下吧!特别是project->Options中,有许多选项的功能都没用过,可能包含着许多技巧,望多多发言,为论坛增加点人气!
[解决办法]
// 俺补充1个,其实是僵哥发现的// 就是每次设置很多个断点后,不知道怎么全部去掉// 按快捷键ctrl +Alt +B,选择Disable all
[解决办法]
补充技巧2:
我的解决办法是用UE直接修改bpr文件,保存时要使用UTF-8编码方式。
[解决办法]
顶一下
[解决办法]
学习了~~
[解决办法]
这不叫编译器使用,应该是IDE,我的技巧就是用ShadowStar CodeFast,哇哈哈^0^
[解决办法]
是我写的IDE插件,类似CodeRush之类的东西,比较简单实用,我现在编程离不了了
[解决办法]
ShadowStar CodeFast
for Delphi & C++Builder
自动代码模板(多输入点)
自动代码完成(智能调用)
自动代码缩进(可配置)
自动代码备份(讨厌.~)
自动匹配输入(可正常输入)
收藏夹
源代码格式化
显示所有书签
F3 查找选中文本
Tab 添加缩进
Ctrl+/ 反转行注释
Ctrl+C 选择或带HTML拷贝
IDE菜单
...更多>>
http://blog.csdn.net/shadowstar 有介绍
[解决办法]
学习中...
------解决方案--------------------
我已经发布了最新版,这里不能上传附件
你可以手动安装:
Project>>Options>>Packages: Add
[解决办法]
纯顶一个。
[解决办法]
纯顶一个。
[解决办法]
Ctrl+Ins Edit|Copy
Shift+Del Edit|Cut
Shift+Ins Edit|Paste
Ctrl+C Edit|Copy
Ctrl+V Edit|Paste
Ctrl+X Edit|Cut
Debugger (default, classic, Brief, Epsilon, and Visual Studio)
Breakpoint view
Ctrl+V View Source
Ctrl+S Edit Source
Ctrl+E Edit Breakpoint
Enter Edit Breakpoint
Ctrl+D Delete Breakpoint
Del Delete Breakpoint
Ctrl+A Add Breakpoint
Ins Add Breakpoint
Ctrl+N Enable Breakpoint
Call stack view
Ctrl+V View Source
Ctrl+S Edit Source
Space View Source (Epsilon only)
Ctrl+Enter Edit Source (Epsilon only)
Message view
Ctrl+V View Source
Space View Source
Ctrl+S Edit Source
Ctrl+Enter Edit Source
Watch view
Ctrl+E Edit Watch
Enter Edit Watch
Ctrl+A Add Watch
Ins Add Watch
Ctrl+D Delete Watch
Del Delete Watch
Editor (default)
Shortcut Action or command
F1 Help|Topic Search
Ctrl+F1 Help|Topic Search
F3 Search|Search Again
Ctrl+E Search|Incremental Search
Ctrl+F Search|Find
Ctrl+I Inserts a tab character
Ctrl+j Templates pop-up menu
Ctrl+N Inserts a new line
Ctrl+P Causes next character to be interpreted as an ASCII sequence
Ctrl+R Search|Replace
Ctrl+S File|Save
Ctrl+T Deletes a word
Ctrl+Y Deletes a line
Ctrl+Z Edit|Undo
Ctrl+<space bar> Code Completion pop-up window
Ctrl+Shift+I Indents block
Ctrl+Shift+U Outdents block
Ctrl+Shift+Y Deletes to the end of a line
Ctrl+Shift+Z Edit|Redo
Ctrl+Shift+<space bar> Code Parameters pop-up window
Alt+[ Finds the matching delimiter (forward)
Alt+] Finds the matching delimiter (backward)
End Moves to the end of a line
Home Moves to the start of a line
Enter Inserts a carriage return
Ins Turns insert mode on/off
Del Deletes the character to the right of the cursor
Backspace Deletes the character to the left of the cursor
Tab Inserts a tab
Space Inserts a blank space
Left Arrow Moves the cursor left one column, accounting for the autoindent setting
Right Arrow Moves the cursor right one column, accounting for the autoindent setting
Up Arrow Moves up one line
Down Arrow Moves down one line
Page Up Moves up one page
Page Down Moves down one page
Ctrl+Left Arrow Moves one word left
Ctrl+Right Arrow Moves one word right
Ctrl+Tab Moves to the next code page (or file)
Ctrl+Shift+Tab Moves to the previous code page (or file)
Ctrl+Backspace Deletes the word to the right of the cursor
Ctrl+Home Moves to the top of a file
Ctrl+End Moves to the end of a file
Ctrl+Del Deletes a currently selected block
Ctrl+Space Inserts a blank space
Ctrl+PgDn Moves to the bottom of a screen
Ctrl+PgUp Moves to the top of a screen
Ctrl+Up Arrow Scrolls up one line
Ctrl+Down Arrow Scrolls down one line
Ctrl+Enter Opens file at cursor
Shift+Tab Moves the cursor to the left one tab position
Shift+Backspace Deletes the character to the left of the cursor
Shift+Left Arrow Selects the character to the left of the cursor
Shift+Right Arrow Selects the character to the right of the cursor
Shift+Up Arrow Moves the cursor up one line and selects from the left of the starting cursor position
Shift+Down Arrow Moves the cursor down one line and selects from the right of the starting cursor position
Shift+PgUp Moves the cursor up one screen and selects from the left of the starting cursor position
Shift+PgDn Moves the cursor down one line and selects from the right of the starting cursor position
Shift+End Selects from the cursor position to the end of the current line
Shift+Home Selects from the cursor position to the start of the current line
Shift+Space Inserts a blank space
Shift+Enter Inserts a new line with a carriage return
Ctrl+Shift+Left Arrow Selects the word to the left of the cursor
Ctrl+Shift+Right Arrow Selects the word to the right of the cursor
Ctrl+Shift+Home Selects from the cursor position to the start of the current file
Ctrl+Shift+End Selects from the cursor position to the end of the current file
Ctrl+Shift+PgDn Selects from the cursor position to the bottom of the screen
Ctrl+Shift+PgUp Selects from the cursor position to the top of the screen
Ctrl+Shift+Tab Moves to the previous page
Alt+Backspace Edit|Undo
Alt+Shift+Backspace Edit|Redo
Alt+Shift+Left Arrow Selects the column to the left of the cursor
Alt+Shift+Right Arrow Selects the column to the right of the cursor
Alt+Shift+Up Arrow Moves the cursor up one line and selects the column from the left of the starting cursor position
Alt+Shift+Down Arrow Moves the cursor down one line and selects the column from the left of the starting cursor position
Alt+Shift+Page Up Moves the cursor up one screen and selects the column from the left of the starting cursor position
Alt+Shift+Page Down Moves the cursor down one line and selects the column from the right of the starting cursor position
Alt+Shift+End Selects the column from the cursor position to the end of the current line
Alt+Shift+Home Selects the column from the cursor position to the start of the current line
Ctrl+Alt+Shift+Left Arrow Selects the column to the left of the cursor
Ctrl+Alt+Shift+Right Arrow Selects the column to the right of the cursor
Ctrl+Alt+Shift+Home Selects the column from the cursor position to the start of the current file
Ctrl+Alt+Shift+End Selects the column from the cursor position to the end of the current file
Ctrl+Alt+Shift+Page Up Selects the column from the cursor position to the bottom of the screen
Ctrl+Alt+Shift+Page Down Selects the column from the cursor position to the top of the screen
Block commands (default and classic)
Shortcut Action or command
Ctrl+K+B Marks the beginning of a block
Ctrl+K+C Copies a selected block
Ctrl+K+H Hides/shows a selected block
Ctrl+K+I Indents a block by the amount specified in the Block Indent combo box on the General page of the Editor Options dialog box.
Ctrl+K+K Marks the end of a block
Ctrl+K+L Marks the current line as a block
Ctrl+K+N Changes a block to uppercase
Ctrl+K+O Changes a block to lowercase
Ctrl+K+P Prints selected block
Ctrl+K+R Reads a block from a file
Ctrl+K+T Marks a word as a block
Ctrl+K+U Outdents a block by the amount specified in the Block Indent combo box on the General page of the Editor Options dialog box.
Ctrl+K+V Moves a selected block
Ctrl+K+W Writes a selected block to a file
Ctrl+K+Y Deletes a selected block
Ctrl+O+C Marks a column block
Ctrl+O+I Marks an inclusive block
Ctrl+O+K Marks a non-inclusive block
Ctrl+O+L Marks a line as a block
Ctrl+Q+B Moves to the beginning of a block
Ctrl+Q+K Moves to the end of a block
[解决办法]
学习中.
[解决办法]
过来学习~
[解决办法]
我也学习
------解决方案--------------------
支持楼主一下。
[解决办法]
好啊,收藏
[解决办法]
帮你顶顶,高手们进来谈谈!
[解决办法]
发现CB2009有一个地方很容易被误导人。
CB2009默认是使用UnicodeString, 但却没有定义UNICODE,使用TCHAR相当于char,
需要在项目选项Directories and Conditionals中指定_TCHAR maps to wchar_t,这个地方默认是char.
选定wchar_t后,就是预定义了 UNICODE, 相当于在所有源文件头加入#define UNICODE。
[解决办法]
cb2007的Shift+Ctrl+J不错,选择一段代码后用此快捷(在光标行对应的左边也有一个按键可点击进入),此状态下编辑可以自动更改所有相同变量名称。
本人还喜欢块拷贝操作,在#define一堆同类常量后,要在switch中n多个case中填他们,用块拷贝快速实现,呵呵
[解决办法]
永远学习,不断前进,直到老死
[解决办法]