macros

How can I schedule a Macro to run automatically in Access 2007

I'd like to have a macro, called Macro1, for example, run every day at 9 AM. It works great on its own from the VB code editor in Access 2007 but I would like it to be able to execute automatically without access being open. Please note that I don't want there to have to be any human intervention, it needs to be able to run automaticall...

c++ metaprogramming madness

consider the following templated datastructures enum eContent{ EINT = 1, EFLOAT = 2, EBOOL = 4 }; template<int> struct Container{ Container(){assert(false);} //woops, don't do that! }; template<> struct Container<EINT>{ Container():i(123){} int i; }; template<> struct Container<EFLOAT>{ Container():f(123.4...

C macro for printf

Is it possible to write a Macro (using token concatenation) that returns fmt for printf ? Eg. #define STR_FMT(x) ...code-here... STR_FMT(10) expands to "%10s" STR_FMT(15) expands to "%15s" ... etc. So that I can use this macro inside a printf: printf(STR_FMT(10), "*"); ...

Copy filtered data to new Excel workbook and prompt with Save As dialog

I have a worksheet which contains some financial data to be transferred to accounting system. Can say I know some things about programming, but Excel macros are little too much for me, so please suggest some (even partial) solutions to my problem. Thanks! Master workbook columns are: Name Account Date Followup Amount Checked Transfer...

Tools to speed the generation of locale files (for rails)

I'm involved in preparing a pre-existing rails application for translation - going through the files under app/views/, finding the text, making a key in config/locales/de.yml (in this case), copying the text into de.yml, and putting t("key") in the view file. Repeat hundreds, maybe thousands of times. This is very tedious. I don't think...

Question regarding C++ preprocessor while using #define to conditionally exclude a main function.

Here's the situation: I have three files, Test1.cpp and Test2.cpp. Test1.cpp can be compiled as-is into a stand-alone application. Test1.cpp also contains some functions that I would like to re-use in Test2.cpp. I'm using an #ifndef #endif block to conditionally exclude the main function of Test1.cpp so that when I compile Test2.cpp, ...

Pulling dynamic data from Sheet2 into Sheet1 then to Sheet3..10

So I have Sheet1 and Sheet2, Sheet1 is user set settings and Sheet2 is a table of values generated by different values in Sheet1. Now Sheet3..10 can be created, which will pull a value from Sheet2 based on calculations on it. The problem I'm running in to is when say Sheet3!H20 is updated from Sheet2!I15, how do I get Sheet3!H20 to have...

Create additional rows in excel

Hi, How can I add new rows from:- Column A Column B Column C 11 Size S 11 Color Yellow 11 Type Q 22 Size M 22 Color Blue 22 Type W 33 Size ...

Adding an _onClick() event function to a link in Flash ActionScript to execute a Microsoft Excel Sub Macro

I know how to add a link to a button in Adobe Flash... But how exactly do I add an _onClick() event to execute a Microsoft Excel sub macro? I have a web browser form in an excel sheet. Excel allows you to draw a browser form on the page and link it to a page (e.g. stackoverflow.com) so stackoverflow.com will show in the browser fram...

Determining Calling Line Without Macro

Is it possible to determine the line number that calls a function without the aid of a macro? Consider this code: #include <iostream> #define PrintLineWithMacro() \ std::cout << "Line: " << __LINE__ << std::endl; // Line 4 void PrintLine() { std::cout << "Line: " << __LINE__ << std::endl; // Line 8 } int main(int argc, char ...

Excel listing named range in a worksheet and get the value

Hi there, How to obtain a list of named range exist in a specific worksheet that start with particular string (for example all named range that start with total) and grab the value? I am trying to do Sub Total and Grand Total of accommodation cost based on the date. I will assign an unique name for each Sub Total based on the Date group...

Delete a MS Word Page using macros

Hi All, How can I delete certain page from MS Word document using macros? The code should be compatible from 2000 to Word 2010. I've tried using page bookmark to delete page but, output is varying in different versions. Is there any other solution than this? ...

Get the label beside my Macro inf a C-code

Hello all, I have a macro that I use to `goto', I want to let the macro know about the label. Example: #define MYMACRO((a),(b)) printf("I have arg: %s, %s with Label: %s at line %d", (a), (b), _GETLABEL_, __line__) mylabel: MYMACRO("a1","a2") This should print: I have arg: a1, a2 with Label: mylabel at line 4 Is it possible to ...

Is it possible to write a macro in Java?

I want to quickly click on another application when some event occurs in my Java application. Given that I know the coordinates on the screen where I want to register a click, is it possible for my Java app to tell the OS to click there? I will probably want to register multiple clicks. I may also/instead want to register keyboard str...

Possible to define a function-like macro with a variable body?

I've been looking at the GCC docs for defining macros and it looks like what I want isn't possible, but I figure if it is, someone here would know. What I want to do is define this macro: synchronized(x) { do_thing(); } Which expands to: { pthread_mutex_lock(&x); do_thing(); pthread_mutex_unlock(&x); } In C++ I could...

Replace a string in a macro variable?

I have a macro where I pass in an argument and use that define a new variable based on the name of the input: #define DO_X(x) char _do_x_var_ ## x; /* other things */ The problem is if I pass in a struct variable, it breaks: DO_X(some_struct->thing) becomes: char _do_x_var_some_struct->thing; /* other things */ EDIT: What I want...

Possible to convert an address assignment to function argument via C macro?

I am working on embedded code and attempting to convert a lot of memory-mapped register assignments to get()/set() function calls. I was wondering if it would be possible to maintain the address assignments sprinkled throughout the code, but change the #defines so they take the assignment in as a function argument. Old Way: #define MOT...

How to find out if this preprocessor macro exists?

Hi, I want to know how to find out if the preprocessor macro __PRETTY_FUNCTION__ can be used with a given compiler (As it is supposed to be non-standard). How do I check this in a header file? What I want to do is something like: #ifndef __PRETTY_FUNCTION__ #define __PRETTY_FUNCTION__ __func__ #endif But, I'm guessing what happ...

How do I use a macro in the data portion of a resource script?

I have the following macros header file (system.h), #define rt_metadata 8000 #define dir_metadata "db\metadata" and resource file (system.db.metadata.rc) #include "system.h" SY_ALLOWDATE rt_metadata db\metadata\SY.AllowDate.xml How do I replace the db\metadata with dir_metadata in the resource file so that it will become some...

Velocity: Is it better to use a Velocity Macro or #include(...) statement for a DIV block repeated many times on different pages?

I have about 10 standard blocks of dynamically generated HTML that get included on a large percentage of pages on my site (informational sidebars). I can use #include statements or define them as a macros, both would work. What's better? I'm new to Velocity and migrating a site from JSP. Why use one vs the other? Why have #include wh...