473,320 Members | 2,111 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Macro question

Hi,

is correct a macro construction like these ones?

#define DEBUG_FLAGS 0x84
[.. Some code below...]
#if DEBUG_LVL && 0x80
[...]
#endif
And these (equivalent) ones too?

#define DEBUG_FLAGS 0x84
[.. Some code below...]
#if (DEBUG_LVL % 0x80) == 0
[...]
#endif
Thank you.

--
Saludos,
Alejandro Torras.

Nov 13 '05 #1
1 2437
Alejandro Torras <at************@IThotmail.com> writes:
is correct a macro construction like these ones?

#define DEBUG_FLAGS 0x84
Fine so far.
[.. Some code below...]
#if DEBUG_LVL && 0x80


1. What's DEBUG_LVL? If it is not defined, then it will be
treated as 0, and the following code will not be included.

2. 0x80 is always non-zero, so this would normally be equivalent
to just "#if DEBUG_LVL".

In conclusion, it's valid, but confusing.
Nov 13 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

25
by: Andrew Dalke | last post by:
Here's a proposed Q&A for the FAQ based on a couple recent threads. Appropriate comments appreciated X.Y: Why doesn't Python have macros like in Lisp or Scheme? Before answering that, a...
699
by: mike420 | last post by:
I think everyone who used Python will agree that its syntax is the best thing going for it. It is very readable and easy for everyone to learn. But, Python does not a have very good macro...
5
by: Eric Lilja | last post by:
Using a macro, can I change what type an object is being cast to? I know, the initial respone to question might be an instinctive "ugly, don't even think about it!" or "don't use macros at all",...
0
by: Spiro Trikaliotis | last post by:
Hello, assume I define a macro like #if <somecondition> # define MACRO(_x, _y) _x #else # define MACRO(_x, _y) _y #endif
5
by: Mason | last post by:
I'm having some problems converting VBA for Word 2000 to code that VB.Net understands. I recorded a macro in Word to add numbering (a. b. c.) to my paragraphs. I managed to translate quite a bit...
17
by: sounak | last post by:
How could we get a macro name from a macro value such that in a header file #define a 100 #define b 200 now the source file will be such that the user gives 100 then the value is outputted as...
7
by: fei.liu | last post by:
#define ONCFILE_ERR1(funcname, name) \ { \ #ifdef DEBUG\ cerr << __FILE__ << ":" << __LINE__ << " duplicated call to " << funcname << " " << name << endl; \ #endif \ } I want to have...
11
by: Remo | last post by:
Hi All I Have Quation About Macro's plz help why do we have # symbol before any macro line #define STOP 0 ... why con't we use the any other symbol like $, @,, plz answer if any one knows...
5
by: krbyxtrm | last post by:
Hi is there a way to 'manage' function execution using macros? #define MY_CALL_MACRO(MacroName) { g_MacroStack.push_back(MacroName); <some code here...>} such that when i use the...
6
by: pedroalves | last post by:
Hi all, This is not a question about how to #define COMMA , Please keep reading. Recently in binutils, we introduced a macro like this: #define STRING_COMMA_LEN(STR) \ (STR), ((STR) ?...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.