macros

Run macro in visual studio when solution is closed

Is it possible to run a macro in Visual Studio 2008 the moment a solution is closed? I would like to delete the .suo-files of that solution, so that the current user settings are not presented to me the next time I open the solution. ...

Getting the GUID of a VS 2008 tool window

Does anybody have a short code sample that can be run in the VS macro editor on how to enumerate the tool windows in VS 2008 and show the GUID for each one? Or do you know another way to find this out? ...

Why are there sometimes meaningless do/while and if/else statements in C/C++ macros?

In many C/C++ macros I'm seeing the code of the macro wrapped in what seems like a meaningless do while loop. Here are examples. #define FOO(X) do { f(X); g(X); } while (0) #define FOO(X) if (1) { f(X); g(X); } else I can't see what the do while is doing. Why not just write this without it? #define FOO(X) f(X); g(X) ...

iMacros is good but unreliable. Is there any alternative?

iMacros is a very nice tool which allows to authomatically fill HTML forms and extract content, includes cycles and many other features. The problem is that it is quite tricky to make it extracting content properly. For example, I have failed to extract all London-to-Tokio flight prices for all the dates between 1/10/08 to 1/12/08 to fin...

How to put breakpoint in every function of .cpp file?

Is there a macro that does it? Which DTE objects to use? ...

How do I make a C++ macro behave like a function?

Let's say that for some reason you need to write a macro: MACRO(X,Y). (Let's assume there's a good reason you can't use an inline function.) You want this macro to emulate a call to a function with no return value. Example 1: This should work as expected. if (x > y) MACRO(x, y); do_something(); Example 2: This should not result...

Converting OOo macros to Excel macros

I have an OpenDocument spreadsheet with macros in StarBasic/OOoBasic that I want to convert into an Excel spreadsheet, with the StarBasic macros translated to VBA. While OpenOffice.org claims to have the ability to translate VBA macros to StarBasic and back, my attempts to have OOo convert these original StarBasic macros to VBA have all ...

Are C++ Templates just Macros in disguise?

I've been programming in C++ for a few years, and I've used STL quite a bit and have created my own template classes a few times to see how it's done. Now I'm trying to integrate templates deeper into my OO design, and a nagging thought keeps coming back to me: They're just a macros, really... You could implement (rather UGLY) auto_ptrs...

Is there a hotkey to speed up the repetitive commits in Eclipse (or a general windows GUI macro tool)?

I am making numerous, minute changes to .php files in Eclipse PDT then committing them and testing on the server. The repetitive six-step commit process is getting tedious: right-click team Commit... click "choose previously selected comment" select in list click OK Does anyone know of a hotkey or other process to expedite this? UPD...

How can I make the Visual Studio debugger stop breaking at data breakpoints which are set to run a macro and continue?

I'm running into an odd problem with Visual Studio 2005: I have a data breakpoint that's set to run a macro and continue (that is, I select a macro and check Continue Execution.) Now, instead of silently running the macro when the value in the data breakpoint (tracepoint, really) changes, I first get a message box informing me that the ...

How can I simulate macros in JavaScript?

I know that JavaScript doesn't support macros (Lisp-style ones) but I was wondering if anyone had a solution to maybe simulate macros? I Googled it, and one of the solutions suggested using eval(), but as he said, would be quite costly. They don't really have to be very fancy. I just want to do simple stuff with them. And it shouldn't ...

What is the best way to do loops in JavaScript

I have stumbled into several methods of looping in JavaScript, what I like the most is: for(var i = 0; i < a.length; i++){ var element = a[i]; } But as tested here (http://www.robertnyman.com/2008/04/11/javascript-loop-performance/), it should probably be written so that the length is only calculated once. In jQuery there is a ....

Defining operators in Boo

I'm looking to move some of my lighter weight metaprogramming from Nemerle to Boo and I'm trying to figure out how to define custom operators. For example, I can do the following in Nemerle: macro @<-(func, v) { <[ $func($v) ]> } Then these two are equivalent: foo <- 5; foo(5); I can't find a way of doing this in Boo -- any id...

How to make a char string from a C macro's value?

For example, how to avoid writing the 'func_name' twice? #ifndef TEST_FUN # define TEST_FUN func_name # define TEST_FUN_NAME "func_name" #endif I'd like to follow the Single Point of Truth rule. Version of C preprocessor: $ cpp --version cpp (GCC) 4.1.2 20070626 (Red Hat 4.1.2-14) ...

How to check for empty array in vba macro

I want to check for empty arrays. Google gave me varied solutions but nothing worked. Maybe I am not applying them correctly. Function GetBoiler(ByVal sFile As String) As String 'Email Signature Dim fso As Object Dim ts As Object Set fso = CreateObject("Scripting.FileSystemObject") Set ts = fso.GetFile(sFile).OpenAsTextS...

How do I program CTRL-F with windows speech recognition macros?

According to the documentation it should be as simple as ^F But this is not working. The program beeps so I know the command did register however the find text window does not popup ...

Purpose of _never_executed()?

I have seen this macro defined before but never really knew its purpose. Can anyone shed light on this? ...

Excel Macro - how to set X axis?

Hi, I have a chart in a Worksheet in Excel and I have a macro set up so that when I change the value in a certain cell the range of data in the chart is set to A2 down as far as the row number corresponding in the this certain cell. What I can't seem to be able to do is to modify the axis as the specified axis no longer covers the rang...

How to make a macro which executes periodically in Excel?

How does one execute some VBA code periodically, completely automated? ...

Relative instead of Absolute paths in Excel VBA

I have written an Excel VBA macro which imports data from a HTML file (stored locally) before performing calculations on the data. At the moment the HTML file is referred to with an absolute path: Workbooks.Open FileName:="C:\Documents and Settings\Senior Caterer\My Documents\Endurance Calculation\TRICATEndurance Summary.html" Howeve...