in reply to Re: Help translating into HTML
in thread Help translating into HTML

Here is everything altogether:

For instance, lets say that the file reads:
C 100
K Perl
K Monks
K Is
K Cool
F 1234
R Whatever
R More
R BlaBla

This will equal (whatever comes after C in the same line is ignored):
<c>
<p>%Perl,%Monks,%Is,%Cool</p>
<t>
<setflag param="1234"/>
<r>
<li>Whatever</li>
<li>More</li>
<li>BlaBla</li>
</r>
</t>
</c>

This is very simple and has been implemented already (see the code at the end), the problem comes when the block begins with an I (capital 'i'), for example:
I 1010
K _EXE
F 1234
R Whatever
R More
R BlaBla

<c>
<p>_EXE</p>
<t>
<ifflag param="1010">
<then>
<setflag param="1234"/>
<r>
<li>Whatever</li>
<li>More</li>
<li>BlaBla</li>
</then>
</ifflag>
</r>
</t>
</c>

Additionally, lines that begin with C or M are ignored (but in the case of C it specifies the beginning of the block, so in that case everything after the C should be ignored and finally written as <c>)

Then, lines that begin with S, are written as: <set name="temant"> </set>, after the <t>.

The # are comments, and should be written as <!-- whatever -->, but this is already done, as you probably noticed.

One more thing, sometimes, a block entry might have many K's (or 1, doesn't matter), but no S or T (and then R's). Please note that S and T are *rarely* within the same block, if there is no T then theres usually an S instead. I've done all this successfully in the last code I sent you, so you can check that from there.

The two problems are: 1) Getting the </then>\n</ifflag> properly added at the end of such blocks,
2) Getting the '%' ignored *only* in such blocks (instead of <p>%_EXE</p>, do <p>_EXE</p>)

Ok, like I said, thats pretty much it, thanks again.

Kind regards,
Marcos