macros

CPP: avoiding macro expansion of a macro function parameter

what I'd like to do (for logging purposes) is something like this: this code has been written to show my problem, actual code is complex and yes, I have good reasons to use macros even on C++ =) # define LIB_SOME 1 # define LIB_OTHER 2 # define WHERE "at file #a, line #l, function #f: " // (look for syntax hightlighting error at SO x...

Disable or Override Ribbon/CommandBar commands in MSWord using VBA

Hi There First of all I'm going to state right out that I've never worked with VB in the context of coding macros before - my skills lie in other areas (PHP, Javascript, getting there with C#, etc). However, I've been asked by a colleague to lock down a document so that the user cannot change font faces, sizes or colours but does still ...

What is your favorite/most productive macro that you have used in Vim ?

I'm trying to know how vim experts use macro's in vim for day-to-day coding - I have a lot of custom shortcuts/mappings that I use frequently , but haven't come across any good ideas of macros. It may have been a macro which you had used before , to simplify a task tremendously - I just need ideas as to how to productively use this fea...

Delphi 7 macro preprocessor support

Is there a macro preprocessor for Delphi 7? There isn't one built in so maybe there's a possibilty to use a third party or some other languages preprocessor (like c preprocessor). If there's one, how to set it up for Delphi 7? I'm trying to do function inlining (for speed). Macro preprocessor seems to be the only easy option for delph...

Programatically filling in a letrec in Scheme. Macros or eval?

I'm just playing with an NFA for string recognition. I have a macro that creates a function which consumes input and passes on the rest to some other functions. Because there might be loops in my NFA graph, I'm using letrec to put the whole thing together. Here is some code (been testing in PLT-Scheme): (define-syntax-rule (match chars ...

turning off DEBUG macros for a specific function (NDEBUG)

Hi, I am using the following macro for printing debug information that I found on the web. It works great. However, I would like to turn-off debug printing for function A when debugging function B, which calls function A. I tried #define NDEBUG function A #undef NDEBUG but haven't managed to suppress printing in function A. Any hel...

Variable arguments in a Macro

I have a function which takes variable arguments, something like the following int log_data (LOG_TYPE eType, ...) { /** some logging related stuff here **/ } In the header file, I use something like #ifdef LOGGING_ENABLED int log_data (int nType, ...); #else #define log_data(_x_, ...) #endif Basically, the idea is to SWITCH deb...

Macro definition for message mapping

Hi all; Formerly I asked a question and got a fair response. But I am stucked with below macro definitions. The below definitions generates a Message Map function like it is in MFC Message Map. But the code below does not compile. Whole statements starting with this-> are problematic ones except the one in MSG_HANDLER this->meth(msg); ...

Can Anyone help with Scripting for Autohotkey to work with Handbrake?

Hi everyone, I'm trying to make an autohotkey script so I can drag and drop movie files into autohotkey for it to put it into handbrake's queue to be converted into iphone format. I just started with autohotkey and have no idea on how to record a macro like that. Can anyone point me the right way or maybe does anyone have a script like...

creating macros in intellij

I am trying to create a macro that takes a selection of text and runs some find/replace on it using a regex. I have recorded this macro in intellij, but when I run it, all I get is the find/replace dialog opened. No find/replace is executed. Has anyone had any luck with creating a find/replace macro in intellij? ...

Print all characters for a font in MS Word

For some automated tests I need to create a Word Doc that contains all the characters of a font (for several different fonts). Is there an easy way to create a macro that loops through all the available characters in a font (and inserts them into a doc)? ...

Change the Target Framework for all my projects in a Visual Studio 2008 to 3.5

I have a just converted a Visual Studio project from 2005 to 2008 to take advantage of the .NET 3.5 Framework features. My solution contains approximately 80 projects and I want to set the Target Framework to .NET Framework 3.5 for all of them. Is there a way I can do this without manually going in and changing them one-by-one in Propert...

Copy and paste cells if Duplicate columns , Excel Macro slightly different question

Hi I have another macro I wanted to create which is very similar to the one that has been given here. This time I don't want to specify a exact word because I won't know what word they will give, instead I would just like it to de dupe and copy whatever it finds in that column to the one respondent. How would I edit this? Thanks Serial,...

Concat Macro argument with namespace

I have a macro, where one of the arguments is an enum value, which is given without specifying the namespace scope. However somewhere inside the macro I need to access it (obviously I must define the namespace there), but I can't seem to concat the namespace name with the template parameter. Given the following samplecode the compiler co...

Is there a crystal reports API in visual studio that I can use to manipulate rpt files using a macro?

I'd like to programmatically manipulate my rpt files using a macro or add-in within Visual Studio 2005. What I want to achieve is the ability to automate updating the custom functions in my reports, since there seems no way to have a single copy of the functions shared between reports. So I'd like to have a macro to: Read the functio...

Macro not in the list after loading the add-in.

I have a created a macro show() and saved it as display.xla and open a new workbook and added the display add-in. But when i went to Tools->Macro->Macro.. its not the list, But if i type display.xla!show and click run im able to execute it. Is there anyway to display the macros stored in the Add-in.? Apart from having it in personal.xls...

C Debug Print Macros

in C, what is the proper way to define a printf like macro that will print only when DEBUG symbol is defined? #ifdef DEBUG #define DEBUG_PRINT(???) ??? #else #define DEBUG_PRINT(???) ??? #endif where ??? is where I am not sure what to fill in ...

How do I add a "browse for file" dialog box to the transferText command?

I'm creating a macro in MS Access that imports a CSV file into a table. I'm using the TransferText action to import the CSV string, and I want to allow the user to browse for the file that contains the CSV string. How do I show the "browse" dialog box to enable the user to choose the file? ...

What is the current state of the art in developing MSFT Office macros in a NON-VBA language?

Long ago writing VBA macros for MSFT Office was part of my job. Now it looks like I may be traveling down that road again, and I have not touched MSFT Office for anything serious in years. Is VBA still the de-facto standard for creating msft office extensions? Is it possible to write (non-second-class-citizen) MSFT office extensions i...

Is there better way to write do-while(0) construct to avoid compiler warnings?

I'm often use do-while(0) construct in my #defines, for the reasons described in this answer. Also I'm trying to use as high as possible warning level from compiler to catch more potential problem and make my code more robust and cross-platform. So I'm typically using -Wall with gcc and /Wall with MSVC. Unfortunately MSVC complain about...