Editor 6.0.8.9 - syntax error on trailing whitespace.

PhilHornby

Senior Member
The following code gives an error:-

Code:
[COLOR=Navy]#define [/COLOR][COLOR=Black]weird [/COLOR][COLOR=Navy]1 
#if [/COLOR][COLOR=Black]weird [/COLOR][COLOR=DarkCyan]= [/COLOR][COLOR=Navy]1
 [/COLOR][COLOR=Green];some statement or other[/COLOR]
[COLOR=Navy]#endif[/COLOR]
"Syntax error on line 2 at position 1

Error: 1 is not a numeric value, try #IFDEF instead of #IF?
"

Untitled.png

It turned out to be caused by whitespace after the "1". For presumably the same reason, it won't allow ;comments or 'comments after the #define statement either - which is a pity.
 

Technical

Technical Support
Staff member
A '#define'' or '#macro' phrase can be used a straight text substitution in the preprocessor, and as there are cases where people want to substitute a whole line/phrase (including whitespace) we don't ban whitespace.

However we may be able to display a more obvious error msg in this case ( e.g. speech marks "1 " to highlight the trailing whitespace).
 
Top