macros

Writing a macro

I'm mostly new to programming and so I have come here for some help. Recently, at work, the program that we have used for years has drastically changed and all of our old file types are no longer supported. This has left us completely out in the cold as to how we can access our old files without using the older software. With that being...

Variadic Macro with 3 terms

I am trying to understand a c++ code that reads a dll explicitly. Does any one know how the line "#define LFE_API(name) LFE_##name name" bellow actually works? I understand "#define LFE_API(name) LFE_##name" but get confused about the last "name". struct Interface { # ifdef LFE_API # error You can't define LFE_API be...

Difference between let* and set? in Common Lisp

I am working on a genetic programming hobby project. I have a function/macro setup that, when evaluated in a setq/setf form, will generate a list that will look something like this. (setq trees (make-trees 2)) ==> (+ x (abs x)) Then it will get bound out to a lambda function #<FUNCTION :LAMBDA (X) ... > via strategic use of function...

GCC 4.5: "checking whether the C compiler works... no" error when CFLAGS="-arch x86_64"

I compiled and installed GCC 4.5.1 via MacPorts in my installation of Mac OS X 10.6.4. When trying to ./configure software (such as, but not limited to: Wine 1.3.0, libjpeg, etc.), I set the compiler flag to CFLAGS = "-arch x86_64 -m64" to make sure that the compiled program will be 64-bit enabled. But I got an error during configure say...

Excel PageSetup Landscape - Losing settings

I have a macro that gathers data and creates a scatter plot and that is saved to a new workbook. Each individual point in the plot has a label (DataLabel). Some of the points are so close together that the the labels are not visible. The user just simply moves the labels around with their mouse. The macro also changes a few things in th...

Using and returning output in C macro

I'm trying to instrument some code to catch and print error messages. Currently I'm using a macro somethng like this: #define my_function(x) \ switch(function(x)) { \ case ERROR: \ fprintf(stderr, "Error!\n"); \ break; \ } Normally, I never capture the function output and this works fine. But I've found a couple ca...

Functions and header files (ansi c)

This is a question from job interview.Let's say we have "a.c" source file with some function and "a.h" as its header file.Also we have main.c file which calls that function.Now let's suppose we have "a.h" and "a.o"(object file) and a.c is unavailable.How do we call this function now? (I had a hint that we need to use function pointers.An...

What does "#define STR(a) #a" do?

I'm reading the phoneME's source code. It's a FOSS JavaME implementation. It's written in C++, and I stumbled upon this: // Makes a string of the argument (which is not macro-expanded) #define STR(a) #a I know C and C++, but I never read something like this. What does the # in #a do? Also, in the same file, there's: // Makes a strin...

What does "#define FOO(template)" do?

I've found some weird C++ preprocessor clauses, like: #define COMPILER_FLOAT_ENTRIES_DO(template) and #define COMPILER_FLOAT_ENTRIES_DO(template) \ template(jvm_fadd) \ template(jvm_fsub) \ template(jvm_f2d) What does passing "template" reserved word to a #define, and calling template(something) mean? I couldn't find any...

Defining the defmacro function using only LISP primitives?

McCarthy's Elementary S-functions and predicates were atom, eq, car, cdr, cons He then went on to add to his basic notation, to enable writing what he called S-functions: quote, cond, lambda, label On that basis, we'll call these "the LISP primitives" (although I'm open to an argument about type predicates like numberp) How would you ...

Predefines for iPhone os and mac os

Hey guys, As im working on a game engine for my company. i got in the setup fase and i need some predefines to check the os on the device / desktop. I need predefines to check when ever the target os is windows / mac or iphone os. Can any one help me with that? god bless you in advance :). ...

Creating a Macro that copies a date from one spreadsheet and moves it into another

Hi there, I have no experience with developing macros but hope you may be able to help. We have 12 excel spreadsheets that monitor the distribution of documents. Each time a document is distributed, the date that document was distributed is entered into its relevant excel spreadsheet. What we would like to do is create a seperate exc...

vba: object variable or with block variable not set

i am doing this: MsgBox ActiveWorkbook.Name and getting the above mentioned error. please note that this has worked for many months and now all of a sudden it does not workl what can i do to fix it? ...

What is the exact use of inline functions?

Possible Duplicate: Benefits of inline functions in C++? Hi, what is the exact usage of inline functions, what exactly inline function does in brief. on what basis a programmer has to choose the function as inline. i Googled the answer but still i prefer stackoverflow. ...

Class name macro

Possible Duplicate: CLASS macro in C++ Hello, are there any ways to get name of class with macro like _FUNCTION_ for function name? The only ideas I have is inheriting some base class with pure virtual toString and define the names by hands eash time. Thanks. ...

Automatically creating OpenOffice macros

Hi, I have written a system which makes use of OpenOffice.org to perform some file conversion. This will be deployed to a number of different servers and I want to make the installation process as easy as possible for the administrator that will be doing it. There are several macros that I have written that need to be added to each ins...

Excel Macro: error when pasting - moving down 10 rows - pasting - 10 rows - pasting, etc

I'm attempting to copy data from three workbooks (one at a time) from the same range (A4:A8) and paste them into a new workbook. The only catch is I'm trying to make the paste part move down by 10 lines each loop. I'm receiving an error message on the PasteSpecial line. I'm not sure why? (I'm an Excel macro novice, but I'm giving it a ...

Mouse script or macro

I search for a script or macro programm, which pushes the 4th or 5th mouse butten every 5 sec. This scrip or macro programm should be for a friend which uses win7 on an asus notebook. I can not try this because i use opensuse 11.0. I have googled but nothing found. ...

Macro to force Excel out of edit-mode

I have a macro that needs to run for update. If Excel is in edit, need a macro to have excel exit edit mode --- take control. ...

Excel Macro On How To Search And Replace Cells With Multiple Values Specified in A Diffrent Sheet.

I found This. But It Dosent work. Not sure what I am doing wrong. In Sheet 1 I want to search and replace certain terms. Such as WH with White, PK with Pink, TT with Two Tone, YE with Yellow and so on. I have a list in sheet three with what to find in one column and what to replace in the same row in the next column. Now I want to us...