[DGD]A problem with macros

Erwin Harte harte at xs4all.nl
Sun Nov 26 14:59:13 CET 2000


On Sun, Nov 26, 2000 at 03:47:47PM +0200, Risto Karjalainen wrote:
> I defined a macro which was something like this:
> 
>   #define FOO "foo\n" \
>   "bar\n"
> 
> This results in a syntax error at the second line. I dunno why, but it just
> does. Is it just me, or is it the driver?

I think it's you (tested with DGD 1.1.75, but I doubt this has changed):

  > cat ~/tmp/defines.c
  #define FOO "foo\n" \
    "bar\n"
  > load ~/tmp/defines
  Succesfully loaded ~nino/tmp/defines.c.
  > 

What would probably cause the syntax error is when you _use_ the
define, because (DGD) LPC does not automatically concatenate strings
like this, if you really want this, try this:

  #define FOO "foo\n" + \
  "bar\n"

Hope that helps :)

Erwin.
-- 
Erwin Harte         :    `Don't mind Erwin, he gets crabby. :)'
harte at xs4all.nl     :       -- Par Winzell <zell at skotos.net>

List config page:  http://list.imaginary.com/mailman/listinfo/dgd



More information about the DGD mailing list