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
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.