macros

Excel commands not available when macro is paused

In Excel 2003, I was able to pause a macro switch to Excel and perform excel functions, then switch back to VB and resume the macro. In Excel 2007 when I pause a macro and switch to excel, most of the excel functionality does not respond. I can switch between sheets and perform 'browse' type functions, but I cannot change cell values or...

Macro undeclared, but defined in header

I'm facing a very weird problem. This is map.h: #define MAP_WIDTH 256 #define MAP_HEIGHT 256 typedef struct { char exit_n; char exit_s; char exit_w; char exit_e; } room; room map[MAP_WIDTH][MAP_HEIGHT]; void generate_map(); And this map.c: #include "map.h" void generate_map() { char room_x, room_y; ro...

Saving vim macros

Does anyone know how to properly save/reuse macros recorded inside of a vim editor? ...

C Macro Question -(x) vs (-x)

I'm going through quiz answers from my professor and a question was: the correct implementation of a function like macro for absolute value is: #define abs(x) ((x)<0 ? (-x) : (x)) #define abs(x) ((x)<0 ? -(x) : (x)) Why is the second one correct vs the first one? And why do you have to use all the (). Like what are the rules invol...

Macro's with n number of arguments

Possible Duplicate: C/C++: How to make a variadic macro (variable number of arguments) Just wondering if this is at all possible., so instead of how im currently handling logging and messages with multiple parameters im having to have a number of different macros for each case such as: #define MSG( msg ...

Add a cell formula in Excel via vba

Hello, I’m not an Excel or VBA expert but I want to insert this current excel formula into cell’s using VBA. Current Excel formula: =IF(OR(ISNUM(D570)=FALSE;ISNUM(D573)=FALSE);"";IF(C573="Total";D573-D570;"")) VBA formula : ActiveSheet.Range("a" & ActiveSheet.Rows.Count).End(xlUp).Offset(2, 12).Value = "=IF(OR(ISNUM(R[-3]C[-9]...

Latex new command

I would like to define a new command like this \newcommand{\bob}[1]{\excerpt \begin{lstlisting} {#1} \end{lstlisting}} and then use it like this \bob{abcd} but i get the following error in latex. text dropped after begin of listing latex EDIT: I tried the following \newcommand{\boy}[1] {{% \begin{Verbatim} % { #1 } % \end{Verb...

How to manipulate pages content inside Webkit window (Using QT and QTWebKit)?

Hello! Please help me to understand, how can I manipulate html content which is shown inside qt webkit window. I need simple operations like filling in input fields and clicking a button. Any tips/article on this? ...

globals, re-entrant code and thread safety

I'm trying to decide whether to implement certain operations as macros or as functions. Say, just as an example, I have the following code in a header file: extern int x_GLOB; extern int y_GLOB; #define min(x,y) ((x_GLOB = (x)) < (y_GLOB = (y))? x_GLOB : y_GLOB) the intent is to have each single argument computed only once (min(x++,...

Hot Key for a VS 2008 Macro?

I've written a little macro for my VS 2008 IDE, and I want to associate it with a hot key. From what I can see, the keyboard shortcuts in the Tools/Options only allow you to select from the predefined actions. Is there any way to associate a hot key with a user-defined macro? ...

Some really ugly C macro

I need some really ugly C macro (as an example, not to any real project), that does some simple thing (like adding one, for example) really hard and unreadable way. Anyone has some idea? ...

How to bind "rest" variables to list of values in macro in Scheme

I want to make a helper macro for writing match-extensions. I have something like this: (define-match-expander my-expander (λ (stx) (let* ([dat (cdr (syntax-e stx))] [var1 (car dat))] [var2 (cadr dat)]) ;transformer goes here ))) So I wanted a macro that will do this let binding. I've started with som...

Mac Excel 2008: Macros?

I know this isn't directly programming related, but at the same time... Mac Excel 2008 doesn't support VBA or Macros...which I need for a class... Does anybody know of a solution? I need a way to write simple macros on Mac in Excel--if it's possible. Please don't give vague answers if you don't know for sure. This is a serious questi...

What's the best way to compare two sheets in an Excel workbook

Given I have the following <Sheet 1> Item QTY A 5 B 1 C 3 <Sheet 2> Item QTY A 15 B 4 C 1 D 8 What is the best way to generate a report showing the difference between sheet 1 and 2? Like <Difference> Item QTY A 10 B 3 C -2 D 8 ...

Easy way to add text above all methods in a solution in VS 2005?

A colleague was working on a Perl script to consume a C++ source file and add text above all of the methods in the file. He was looking to develop code using regular expressions from the ground up to detect the top line of the method: void MyClass::MyMethod(int somethingOrOther) Trying to do this from scratch is fraught with landmine...

Prolog shortcut to creating a custom enumeration

I am trying to create a custom enumeration via a series of facts. greater(X,Y) :- less (Y,X). less(a,b). less(b,c). less(c,d). This works fine, however there is significant repetition. I'm trying to cut that down. Is there a way to use an array for a simple linear series of facts via a transformation? transform([a,b,c,d]) result...

Calling macros inside macros in EMACS

Hi, I don't know how to call a macro inside another macro avoiding the ring bell stop of the inner macro, because that stops the external macro. In particular, I have to make two searches , and I've defined one in one macro and the other have to search some folders and call in each folder the inner macro, but the external macro cannot co...

Multiple Colum data into one with a twist

Good Morning, I need to parse huge volumes of data that looks like the following and need to run through multiple columns and put it in 1 column. the data looks as follows. Col1 Col2 Col3 Col4 Col5 Co6 Col 7 a b C d 1 2 3 e f g h 4 5 6 The output post macro, need to look like follow. Col1 ...

once a form is filled in and submitted how do make the next form use the next row in a database

Hi Im trying to create a form in Excel and am using macro for the first time. I want a form in sheet1 that when submitted it records the answers in a database in sheet2. i have managed this but when i fill in the form for the second time it overwrites the row in the databse and im not sure how to make it auotmatically use the next row ...

How to create a Appointment in a Shared Calendar (Sharepoint) with VBA (Macro)?

I am actually trying to make an appointment from an excel spreadsheet. I have all the information of the appointment, like subject, body, start and end dates, I actually can create an appointment but only with my personal calendar in outlook. How do I copy/move/create an appointment in a shared calendar in a sharepoint server? I've tri...