Re: Is there any sort of preprocessor functionality in PHP4?
..oO(Robert K S)
>Setup: I have a big tree of "if" statements (imagine the PHP code
>version of a choose-your-own-adventure story) and I want to be able to
>tell which end-branch I've reached. Right now, l have all the end-
>branches numbered with integers, and the integer of the end branch is
>returned.
>
>Problem: If I insert a new end-branch, I have to laboriously re-number
>all the end branches that come after it. As the tree gets larger and
>larger, this becomes more and more of a hassle.
>
>This has me wondering if PHP has any functionality that would allow me
>to have the engine auto-insert the numbering for me on a pass of the
>script that would occur prior to execution. That way I could make the
>script just have some sort of ++ deal at each end branch, rather than
>assigning the numbers in the script by hard-coding them in.
>
>Alternatively, is there some other way to accomplish the same thing?
It would to post some more details about what you're trying to
achieve.
Micha
|