News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

#If problem

Started by Controller, November 11, 2011, 11:05:51 PM

Previous topic - Next topic

Controller

Just tried to change from Microsoft to GoRC, but have some issues:

#define XaA 0
#if (XaA)
#else
1000 BITMAP "themeres\Calaym_btn_BackFwd.bmp"      // Forward / backwards seperate because never 'marked'
#endif


With GoRC, the bitmap is not included, with Microsofts rc it is.
If I change the condition to:
#if (XaA > 0)
it works, but that would require lot's of changes in the resource scripts.
(GoRC.Exe Version 0.90.5)

jorgon

Hi Controller

Welcome to the forum.

Both GoRC and RC return "FALSE" if the word in the conditional test is not defined at all.  In your example this would happen if you commented out the #define XaA line.

Where the word in the conditional is defined, but there is no conditional statement given, then GoRC returns TRUE.  This seems to make sense, because it is the reverse of the scenario above (the conditional not being defined at all).  And since there is no further test to apply, it is reasonable to assume this is the intended test. 

In this second case therefore, yes there is a difference between GoRC and RC.

I wonder whether in your code you could make use of the first scenario as a workaround.  So that instead of setting XaA to zero, you comment out the definition?  Then GoRC behaves the same as RC.

Author of the "Go" tools (GoAsm, GoLink, GoRC, GoBug)

Controller

Quote from: jorgon on November 12, 2011, 02:08:01 AM
Where the word in the conditional is defined, but there is no conditional statement given, then GoRC returns TRUE.  This seems to make sense, because it is the reverse of the scenario above (the conditional not being defined at all).  And since there is no further test to apply, it is reasonable to assume this is the intended test.

Thought that's why "#ifdef" exists.