in reply to Re: Mixed-up output
in thread Mixed-up output

OMG, Chipmunk, ovid, eg, you're all right... :~(
I can't believe I was sitting on that silly thing for 4 hours without noticing. However, chipmunk, can you explain your solution? I see how you integrated my code better inside itself so it won't run over the same thing twice - but what you did is:
Print template up until <!-- MAIN --> Print template from <!-- ENDMAIN --> to end. Print the contents of form.txt then print template again?
and it will appear in that order? Am I missing something, or did you just misunderstand my initial intention of placing one within the other?

-Nimster

Replies are listed 'Best First'.
Re: Re: Re: Mixed-up output
by chipmunk (Parson) on Jan 16, 2001 at 01:40 UTC
    I think the second step is the one that's not clear. Here's how my solution works:
    Read and print from TEMPLATE until <!-- MAIN -->. Read but don't print from TEMPLATE until <!-- ENDMAIN -->. Read and print everything from FORMTEMPLATE. Read and print everything that's left from TEMPLATE.
    I figured that <!-- MAIN --> and <!-- ENDMAIN --> may contain some text that should be replaced by the form. The second loop just skips over all of that.