[comp.windows.x] Resource file question

rahat@Atherton.COM (Rahat Modi) (11/11/89)

Hi,

I have a question about Resource files.  I am running X11R3 on the Sun and 
DecWindows on VMS.

Is the character to introduce a comment in a resource file a '!' or '#' 
or either?

  Appendix A (Resource File Format) of the Xt document (on the tape)
  which shows the EBNF syntax says that it is a '!'. 

  The xrdb program recognizes the '!' and '#'  as the comment character. If you
  give it a file that has lines begining with '#' cpp complains so you must 
  specify the -nocpp option.

  On VMS only the '!' seems to work. 

  Douglas Young's book (X window systems programming and applications with Xt)
  shows example resource files with '#' characters for comments.

  A brief look at the code in Xlib which builds the resource database, shows 
  that it seems to recognize only '#' as comment lines and will create 
  resource database entries for lines begining with '!'. (correct me if I
  am wrong here).

Is this a bug in the documentation ?
All responses to this will be appreciated.

Thank you.

p.s. You can e-mail responses directly to me.

Rahat Modi
Atherton Technology, 1333 Bordeaux Dr., Sunnyvale, CA, 94089 (408)734-9822
   E-mail:     rahat@Atherton.COM
   UUCP:      {decwrl,hpda,pyramid,coherent,sun}!athertn!rahat

swick@ATHENA.MIT.EDU (Ralph R. Swick) (11/11/89)

> Is the character to introduce a comment in a resource file a '!' or '#' 
> or either?

Officially, it's supposed to be '!'.  The confusion is that '#' was
used in X10 but when X11 was being built, it became clear that
allowing an xrdb-like program to use cpp (or at least cpp syntax)
would be a big win.  The Xlib implementation supported '#' silently
for backward compatibility with old users but neglected to also
ignore '!'.  This bug is fixed in R4.  Nothing really bad happens
if you use an "unsupported" comment character except wasted memory
at runtime.