Disclaimer: I'm not a visual basic programmer. In fact I don't know visual basic at all; this was my first experiment in vb.
Over the years I've been fighting with Microsoft Visual Studio 6 editor, and missing many of Scintilla's features; one of the most useful is the capability to comment/uncomment a line of code. So I wrote this little macro, and usually bind it to a Ctrl+Q; hope someone will find it useful!
Tipographic note: to constrain this code in blog's page width, I've had to break long lines with '\'. I don't know if this line-break is acceptable to vb, so don't copy&paste blindly.
Sub CommentUncomment()
'DESCRIPTION: Comment/Uncomment a line of C++ code.
'Begin Recording
StartLine = ActiveDocument.Selection.TopLine
EndLine = ActiveDocument.Selection.BottomLine
If EndLine < StartLine Then
Temp = StartLine
StartLine = EndLine
EndLine = Temp
End If
For i = StartLine To EndLine
ActiveDocument.Selection.GoToLine i
ActiveDocument.Selection.StartOfLine \
dsFirstText, dsMove
ActiveDocument.Selection.CharRight dsExtend, 3
if ActiveDocument.Selection.Text = "//~" Then
ActiveDocument.Selection.Delete
Else
ActiveDocument.Selection = "//~" + \
ActiveDocument.Selection
End If
Next
'End Recording
End Sub
error LNK2001: unresolved external symbol "public: __cdecl std::_Lockit::_Lockit(void)" (??0_Lockit@std@@QAA@XZ)Solution:
#ifndef _MT
#include <afxwin.h>
#include <yvals.h>
namespace std {
_Lockit::_Lockit() {}
inline _Lockit::~_Lockit() {}
}
#endif //_MT
<<<<
2006-2008 Giuseppe 'Cowo' Corbelli | Cowo's homepage | Cowo's photo page | Contact me | Back to top
Design by Andreas Viklund | Serendipity Template by Carl