Visual Basic for Applications (VBA) is a macro language of Visual Basic that can be used primarily to extend the application functionality of Windows, especially Microsoft Office software, including Excel, PPT, Word, Outlook, and so on.
Excel documents developed with Excel VBA need to turn on Excel's macro functionality when running in Excel, otherwise the VBA Automation feature of this document will be completely masked and the document's functionality cannot be implemented.
Therefore, before
How do I implement data exchange between two cell ranges in an Excel table? Usually we use the Cut-and-paste method to do this, but this method is cumbersome, and error prone if the data area is larger. Let's try to write a "macro" that can implement that functionality.
On the Tools menu, open macros, select Record new macros, and in the Personal Macro Workbook (Personal.xls), create a macro called Ex
Macros (MACRO) in C (and C + +) belong to the category of compiler preprocessing and belong to the concept of compile-time (rather than runtime concepts). The following is a brief summary of the use of macros that are commonly encountered.
About # and # #
In the C language macro, #的功能是将其后面的宏参数进行字符串化操作 (stringfication), simply by adding a double quotation mark around the macro variable that it references
It is often useful to merge two tokens into one while expanding macros.
It is useful to merge two symbols into a symbol when you make a macro expansion.
This is called token pasting or token concatenation.
This is called symbol stitching.
The ' # # ' preprocessing operator performs token pasting.
# #预处理操作符就用来执行符号拼接
When a macro was expanded, the two tokens on either side to each ' # # ' operator are to a single combined,
When the macro expands, in # #
(1) Parameter passing: macros can be easily inherited before the code variables, functions, inline functions are dependent on the parameters and global variables(2) code generation macros and inline function generation are replaced when there is no stack at the time of the function call, so the execution efficiency will be higher than the function, without the risk of stack overflow, but will generate more
You can create 4 auto-run macros in standard modules in Excel, which are Auto_Open (run automatically when you open the workbook), Auto_Close, Auto_Activate, Auto_Deactivate. These autorun macros are reserved for compatibility with EXCEL5 and 95. You can now replace them with the Open,close,activate,deactivate event of the workbook.So, what is a "standard module"? In fact, the module we inserted in the VBE,
Preface:
Over the past few days, I have looked at the ATL interface ing macro, and then I suddenly came up with the idea of writing it. ATL defines many interface ing macros. Several of them are more important, although it seems that it is not necessary to clarify all its details, however, in the process of deep learning, you can also learn other ATL classes by taking a look at the mechanism of the class. It should be helpful. I wrote it according to
Macros and variable parameters
Let's talk about macros today. What? Can macros also be variable parameters? Yes, you have not heard the error. The macro with parameters is the same as the function, and variable parameters are also supported. The following describes a small program.
CPP Code
# Include
# Include
# Define outscreen (MSG,...) printf (MSG ,_
QT Global Macros and variablesQT Global functions and macros are now collected in the work as followsqt_version: (major Detection version Number:Qt_version_check (major, minor, Patch) ((majorWhen you use namespaces, some macro definitions :Namespace Qt_namespace {}//namespace definition# define QT_PREPEND_NAMESPACE (name):: Qt_namespace::name# define Qt_use_namespace using NAMESPACE:: Qt_namespace;# define
First, let's talk about the following content: ##,__ VA_ARGS __, _ FILE __, _ LINE _, _ FUNCTION _, etc.Macro variable:For example, the above macros are used:
#define myprintf(...) printk("[lch]:File:%s, Line:%d, Function:%s," \ __VA_ARGS__, __FILE__, __LINE__ ,__FUNCTION__);
Here # define is used to replace myprintf () with the next large string of content, while the content of... in brackets is copied to the position of _ VA_ARGS _ as is. The fi
ordinal that distinguishes commands.The value in the "read-write zone" in the command code may be _ioc_none (0 value) indicating no data transfer, _ioc_read (read), _ioc_write (write), _ioc_read|_ioc_write (bidirectional).The kernel defines the 4 macros _io (), _ior (), IOW (), and _IOWR () to assist in generating the above cmd. The following analysis of the implementation of _io (), other similar.
You can see the definition of _io () in asm-ge
Original:Begin_message_map (Cmy1dlg, CDialog)//{{afx_msg_map (CMY1DLG)On_wm_syscommand ()On_wm_paint ()On_wm_querydragicon ()On_bn_clicked (Idc_button1, OnButton1)//}} Afx_msg_mapEnd_message_map ()Afx_msg_map, this macro is an auxiliary macro used by MFC to construct a message map table, buried in a class-aware macro or dynamic recognition macroBegin_message_map (Cmy3view, CFormView)//{{afx_msg_map (Cmy3view)Note-the ClassWizard would add and remove mapping
To learn how to develop the Qt plugin, search for QtPlugins or HowtoCreateQtPlugins in QtAssistant to see the manual introduction. Several macro Q_DECLARE_INTERFACE (ClassName, Identifier) Thismacroassociatesthegiv are involved.
To learn How to develop the Qt plugin, search for "Qt Plugins" or "How to Create Qt Plugins" in Qt Assistant to see the manual introduction.
Several macros are involved.
Q_DECLARE_INTERFACE (ClassName, Identifier)
This macro
1. Macros (macro)wording :${buildpageurl (url2,page.pagenum+1,page)}" > (note: This place can directly call the function in the FTL where the macro is located) next page Introduction Method: Invocation Mode:2. Functions (function)notation: Introduction Method:Invocation Mode:${buildpageurl (url2,page.pagenum+1,page)}3. Different placesMacro: Can be returned early, such as But not Macro, the main role is to splice the content, the macro inside the stri
Run Macros in IDE with shortcuts
If you have not renamed a temporary macro, press Ctrl + Shift + P or select "Run temporarymacro" from the "macro" sub-menu on the "tool" menu to run it. However, even if you have renamed it, you can still access it with a shortcut key. Visual Studio. NET provides one or more key associations (or "bindings") to the shortcut key to call the macro method. When you press the key sequence, a macro is executed. The followin
Auto-assign by macroProgramAdd comments .. add comments to each function, class, and file. because I found some of these things are the same. it also takes time to make comments nice and clear. At this time, we can use macros to help us. for example, I have defined two macros. One is to annotate the file (corresponding to the Hot Key Alt + H), and the other is to annotate the function (corresponding to the
In Noip, macros are often used, so here's a look at the definition and usage of macros in C + +
first Usage--match conditional compilation : #define DEBUG
Defines a identifier called Debug. It should be used in conjunction with #ifdef or #ifndef. Examples are as follows:#define DEBUG#IFDEF debugvoid Print (int v) {cout If the symbol debug is present, then the compiler compiles the above prin
Defining some macros using # define, making some neat substitutions, and even some macros with parameters, are common in Linux C code, which means it's good and useful.But it also has some complicated rules and traps to note, and I'll record some of them for reference only.1, when using "\" To change lines, the second line to shelf write, otherwise there will be more than a space. For example:#define OW "Wh
C + +, the macro substitution is written to a string, but runs at a time inconsistent with expectations.Look at the code first:#define _var_arg_20#define _var_arg_40 (+)#define _var_arg_spec (20-30) Char"Target Pin[_var_arg_20]:value[_var_arg_40]:spec[_var_arg_spec]";Compile no problem, when running, the individual macros in STR are not replaced. The first reaction is that the macro is replaced at the time of precompilation, and there should be no
Source: Ios_ Komatsu
Links: http://www.jianshu.com/p/be00c3f3cafd
We all know that using macros is not only convenient, but also can improve development efficiency. The following summarizes some of the commonly used macros in the iOS development process, which will continue to be added.
Whether the string is empty
#define KSTRINGISEMPTY (str) ([str iskindofclass:[nsnull class]
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.