macros

C - the most useful user-made C-macros (in GCC, also C99) ?

What C-macros is in your opinion is the most useful? I have found the following one, which I use to do vector arithmetics in C: #define v3_op_v3(x, op, y, z) {z[0]=x[0] op y[0]; \ z[1]=x[1] op y[1]; \ z[2]=x[2] op y[2];} It works like that: v3_op_v3(vectorA, +, vectorB, ve...

How to create macros/shortcuts in Dreamweaver or Notepad++

I've never made "macros" or anything like that with any program. I'm moving my php code to use "gettext", so I have to look for all my static text and change it up. For example, I need to change page title to <?php echo _('page title'); ?>. I don't think there is a way to change it all up in one shot, as it involves looking to see if ...

outlook macro - why doesn't this delete all items from deleted folder?

I have the following macro in outlook to clear my deleted folder. its strange as it doesn't seem to delete all entries. I have to run this a few times for it to clear to deleted items folder. (usually 2 or 3 times). Each time the number of deleted items in the folder does get reduced but i dont understand why everything doesn't get wi...

Copy and paste cells if Duplicate columns , Excel Macro

Hi, I am not very techi-but I have been recording and editing basic Excel Macros for a little while. I have found a few results which almost match my issue, however I am struggling to adapt it so I am hoping someone might be kind enough to help me?! my issue: Sheet 1 a/b/c/d name/black/blue/green Sam/1//1 Jill//1/ Jill/1// Sam//...

problem with keyboard simulate press event.

im trying to make a automated tool for poulating textboxes with usernames for a dispatcher application at work. Im having some problems trying to simultate key press, if the inputArrayX[i] array contains a,b,c the keyboardsim will press abc, but if the Array contains a,b,b,c,c it still only types out abc, and not abbcc like i want it t...

How do I stop Auto-Complete during macro execution in Visual Studio?

I am working on a couple of macros and whenever I am insterting text the Auto-Complete functionality is running and causing problems. This is also described in the comments of this question. I can manually disable the autocomplete check boxes that are interfering but that isn't really what I am looking for. Is this where the Undo Cont...

Properly handling platform specifics (unix/windows) in C?

This question is intentionally very generic and I'm not much of a C programmer although I dabble here and there. The following code is intentionally vague and probably won't compile, but I hope you get the point... Handling platform specifics seems dynamically in a compiled language like C seems unnecessary and even scary: int main(in...

[C++] Map functions of a class

Hi! Before I was trying to map my classes and namespaces, by using static calls I succeded and now I need to map the functions of my classes because they will be used dinamically. Firstly I was thinking to hardcode in the constructor so I can assign a std:map with the string of the name of function pointing to the function itself. f...

iPhone - calling a method in parent view controller

Hi, have hunted around for an answer to this one, but can't seem to find a definitive solution - hoping someone can help here! I'm building a multiview app for the iPhone. I've created a UIViewController called "MainViewController", which loads in other views as required. There's quite a lot of navigation between screens, so what I'd ...

Copy a column of data from one excel file to another file..

Hi.. I am a newbie in writing macros. I have an excel file in which a column (total hours) is present. As I update the 'total hours' column I need those values to be reflected in another excel file under a column (Efforts). Can anyone give me the macro for the above said problem.. Thanks in advance ...

Can I redefine a c++ macro for a few includes and then define it back?

I am using both the JUCE Library and a number of Boost headers in my code. Juce defines "T" as a macro (groan), and Boost often uses "T" in it's template definitions. The result is that if you somehow include the JUCE headers before the Boost headers the preposser expands the JUCE macro in the Boost code, and then the compiler gets hop...

How to make a macro that can take a string?

I'm trying to do something really trivial: A macro that takes an string and prints that to NSLog. Like this: #define PRINTTHIS(text) \ NSLog(@"text"); However, when I try to pass a string to this guy I end up getting "text" printed to the console. Aren't all variables replaced on a string-level inside the macro? How to do that ri...

Is there a way to hide certain macro calls from the editor in Xcode?

I'm using the latest Xcode 3.2. I have a lot of macro calls in my code which are used for debugging. They generate very useful information about the current execution path and help a lot to understand what's going on. That said, those macros practically look like this: LogNote(@"unload foo controller because bar controller has replaced...

Assign rights to folder VBA

Hi , I use the below code to assign rights to the folder this works fine when i create a folder on say "C:/Test" and run the code it works fine without any issues but once i try the same with the folder "C:/Documents and Settings" i get an error . Here is the code its a VBA code done on a word document. Dim intRunError, objShell, o...

batch concatenating of png images to single file.

Hi, I want create texture atlas(matrix of images) from multiple images.Is their any applescript that can create image matrix. ...

C/C++ Macro expansion vs. Code generation

Both Macro expansion & Code generation have pros & cons. What's your favorite approach and why? When should we choose one over the other? Please kindly advise. Thank you! Macro expansion can be very handy & helpful: http://dtemplatelib.sourceforge.net/table.htm vs While Code generation gives you plenty of nice code: http://code.google...

Excel Macro help on SQL select remove column limit-Logged in!

Hi, Sorry I have just created an abccount and lost the thread for the last query I just placed. Anyone know how to link it back up with my openid? Query below. This is really another question linking with the question before. I have an issue where I have a code written however it will only let me select 22 columns then comes up with 'to...

Can I implement code snippets at runtime in vb?

I need to port an old Clipper app to vb.net. It relies heavily on user-written macros and indeed would be almost impossible to create without them. As VB is interpreted, I am sure it must be possible to implement code that the user has entered, but I have no idea how to do so! For example, I might have a text field txtMacro, into which ...

Record Keyboard Macros in C#

How do I set my application to record keyboard macros. Like Shift-Alt-I would open Internet Explorer. I know that this feature is avaliable in Windows, but I don't think it's very good. I have a textbox control and a button that says "Record keyboard Macro". ...

Please refactor my macro in Scheme

I am learning hygiene and I tried to make a simple for loop in Scheme. I want to support three kinds of constructs as shown in example below (for i = 1 : (< i 4) : (++ i) (printf "Multiplication Table for ~s\n" i) (for j = 1 to 5 (printf "~s * ~s = ~s\n" i j (* i j)))) I want to also support for loops with filters like this:...