LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   Language agnostic configuration tools? (https://www.linuxquestions.org/questions/programming-9/language-agnostic-configuration-tools-335161/)

rsheridan6 06-19-2005 11:32 AM

Language agnostic configuration tools?
 
I'm starting out at web development and I've written some CGI scripts, html, javascript, and css. They all refer to variables in each other, and I'd like to keep them all in tune. If I were writing in just one language (which is all I've ever done before), I could do something like:

#define MYCONSTANT 1

But that obviously won't work across 4 or more files written in 4 or more languages. Any suggestions?

Hko 06-19-2005 12:46 PM

If you use PHP instead of CGI, you could define constants (macro's) to use in all of: PHP, html, javascript and, with a bit of fiddling, also CSS.

You would write this instead though:
Code:

define('MYCONSTANT', 1);

jonaskoelker 06-19-2005 12:51 PM

I would suggest looking at a generic macro (pre-)processor, such as GNU m4.

rsheridan6 06-19-2005 06:45 PM

Thanks, M4 looks like what I'm looking for.

jonaskoelker 06-19-2005 11:46 PM

Quote:

Thanks ...
I'm glad I could help :)

--Jonas


All times are GMT -5. The time now is 05:46 PM.