0
votes
1answer
37 views

excel macro, that runs when workbook opens, doesnt update cell with formula

Scenario: Need to create an excel that fetches data from multiple sources and concatenate text into a few cell so as to be used as part of report. Goal: To have better formatting of the final output ...
0
votes
2answers
28 views

coffeescript macro for function declarations

Functions in Coffeescript can't be hoisted, since it doesn't function declarations, only function expressions. How can I write a macro to add function declarations to coffeescript? Specifically, I ...
0
votes
2answers
35 views

Change between two function definitions with macros

I'm working on two different LCD initializations. One is from the Professor's hardware and the other one is mine. I want to switch between two functions using macro definitions: #ifndef LCD_Professor ...
0
votes
1answer
23 views

Transpose clumps of cell on openoffice calc

Is there a function that can help trun this : A B C D E asa fafa ada sawewf wefw ff rwf fw rww er rr 23 into this: A B asa fafa wefw ...
0
votes
1answer
45 views

Macro Loop with Dynamic Range

I'm trying to automate the following process using a Excel but I'm experiencing some difficulties as obviously I need to set up a variable within the OFFSET function: Sheets("XXX").Visible = True ...
1
vote
3answers
83 views

Is the Macro argument a function?

I am trying to determine whether a given argument within a macro is a function, something like (defmacro call-special? [a b] (if (ifn? a) `(~a ~b) `(-> ~b ~a))) So that the following ...
2
votes
5answers
90 views

Why should or shouldn't we prefer a macro that accepts arguments over a function that does the same job?

Following are two programs that give the area of the circle when the radius is passed as argument.But in the first program, macro.c, I am using a macro for the job ,while in the second,function.c I am ...
1
vote
1answer
86 views

How to keep variable amount of numbers after decimals

I am using Excel 2007. I have multiple data sets with random number of characters in each row. For example: A1 1.60 A2 0.008 A3 0.900 A4 1.0 A5 0.56 A6 1.703 I need to make it into a ...
1
vote
0answers
46 views

macro to check if the return value of a function is being checked

I have a function void *custom_get_value(ObjectPtr) This function traditionally never used to return NULL.It can return any of the following values uint32_t int32_t uint64_t int64_t uint8_t ...
2
votes
2answers
120 views

Creating a macro that uses a function with a variable

Heres my code: Dim N As Single N = ActiveCell.Offset(0, 0).Value E = 1 - N ActiveCell.Offset(0, 1).Range("A1").Select ActiveCell.FormulaR1C1 = "=-SUM(R[E]C:R[-1]C)" ActiveCell.Offset(0, ...
0
votes
2answers
66 views

How to pass the result of a function as a Macro variable?

Say I've set up a macro expansion as follows... #define WARN_START @"DANGER" #define WARN_RESET @"THE COAST IS CLEAR" #define WARN(x) WARN_START x WARN_RESET INPUT WARN(@"*** Your boss is coming. ...
1
vote
2answers
108 views

c variadic functions confusion

I'm trying to figure out what's behind va_start(), va_arg() macroses. The code below works well. #include <iostream> #include <cstdarg> void f(double a, double b, ...) { va_list arg; ...
1
vote
2answers
47 views

Is it possible to instrument matlab functions to automatically compare values of local variables across functions?

This is related to How to retrieve local variables?, but broader in scope. The scenario looks like this. Suppose I have two functions function [OutA OutB OutC] = F1 (x,y,z) local1 = x + y - z ...
0
votes
1answer
24 views

VBA HasNextCell function

I have tried searching for a solution but cant find it. I have a list of products, and each product has many parts. Is there a HasNext function in VBA to see if there are more parts for a product? ...
0
votes
2answers
40 views

Delete an Excel Column while inside another subroutine?

I have a Macro that concatenates the values in two adjacent columns. It works perfectly. I'd like to add a command to then delete the second column once the concatenation is complete. Can I do this ...
0
votes
0answers
105 views

Excel - conditional row hiding/outlining

I am trying to solve a problem - hiding unwanted rows when printing. I have a spreadsheet with two columns, A and B. Column A contains item names (e.g. "paper", "pencils", "rubber" ...) from row 3 on, ...
2
votes
2answers
76 views

Is it possible to use a macro in function prototypes and definitions?

I have a few functions sharing common arguments I want to pass across, so is it possible to use a macro to save me from repeatedly writing out the common arguments? As an example, would the following ...
-1
votes
2answers
156 views

copying and sum cells with same value in a column [closed]

I need function or macro in excel to count cells with same data in a column: mn3288a mn3088a mn3088a mn3088a mn3288a 3009-3001 LKE1 LKE1 LKE1 mn3088a 3001-3009 The result ...
4
votes
4answers
2k views

C++: Empty function macros

If I define a function macro with no actual function, is it like an empty string with the compiler (i.e. It doesn't generate any extra instructions at compile time)? Example: #define SomeMacro(a) ...
3
votes
5answers
175 views

What's the safest way to define short function name aliases in C++?

Suppose I have a class Utility in a file utility.h: class Utility { public: static double longDescriptiveName(double x) { return x + 42; } }; And then I find that I use the function ...
0
votes
2answers
533 views

C++ Passing multiple arguments in one argument

This may sound confusing, but how can you pass MULTIPLE ARGUMENTS in one ARGUMENT. What I've tried is the following: #define CALL(v, look, param, expect) v(param){look(expect);} Example when using ...
0
votes
2answers
3k views

Excel - Compare one column to another and display results

In Excel 2007, I have two columns, similar data (list of names). If the name is found in both columns I'd like to change a blank column to active. How can this be done? Longer Description of what I'd ...
0
votes
2answers
88 views

Assigning an array to a function macro

I recently came across the below code where macro is defined as below unsigned char cbuf[10]; #define pbuf() (&cbuf[0]) Can anyone please explain what is being done in the #define(macro ...
2
votes
1answer
123 views

Clojure: how to send remaining arguments “& args” into list?

Is there any (reasonable) way to write this macro as a function? (defmacro assocTop [v & args] `(push (pop ~v) (assoc (peek ~v) ~@args))) Given a vector of ...
3
votes
1answer
79 views

How to check for accept4 using CMake

I am checking for accept4 on Linux like this: check_symbol_exists(accept4 sys/socket.h HAVE_ACCEPT4) However, accept4 is only defined if _GNU_SOURCE is defined beforehand. How can I force the ...
2
votes
2answers
446 views

Using preprocessor directives to define generic functions in C

I just came to C from C# and was looking for a way to define generic functions like those in C#. I came across this post but when I tried to compile it I get a bunch of errors ("`n' undeclared here ...
1
vote
4answers
744 views

ABS(A) and abs(int)

I am baffled in the difference of this two in xcode, ABS(A) and abs(int). Cant seem to find ay explanation online as well. Which should I use? I am actually working on an accelerometer. Using ABS(A) ...
-1
votes
1answer
2k views

Find and copy cells from adjacent worksheet to current worksheet

I need to create a macro (or function) to copy cells from an adjacent worksheet to the current worksheet if they meet certain criteria. Below is the worksheet adjacent to the current worksheet that ...
0
votes
1answer
74 views

Higher-order functions and short forms

Why we can write (defn factory-foo [] (fn [] (println "foo"))) (apply (factory-foo) []) but not: (defn factory-bar [] #((println "bar"))) (apply (factory-bar ) []) ;throws NPE Is this a bug? ...
1
vote
2answers
164 views

Using a macro inside a loop condition

I am programing in C++ and I defined a variable as a macro, and I want to return a value from a function using the macro. For some reason the compiler says that I have a syntax error. I am using ...

1 2 3
15 30 50 per page