<div dir="ltr">This is probably coming too late but I was going to suggest earlier that the "end" directive be changed to "endif" to be more consistent with other programming languages. I've been away from programming for a long time - many languages (Java, C++, PHP) seem to use braces to end a control loop nowadays. No big deal either way.<div><br></div><div>Also, in your example, would an "Else" directive before the "<span style="font-size:16px">[0x1c resolution 22]" </span>the do the job? The program would still have to 'remember" that it was evaluating the "if " statement above, however.</div><div><div><br></div><div>Dave</div></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Mar 8, 2017 at 3:34 PM, Gerd Petermann <span dir="ltr"><<a href="mailto:GPetermann_muenchen@hotmail.com" target="_blank">GPetermann_muenchen@hotmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">It would not work because 1=1 is interpreted as<br>
$1='1'<br>
and that will probably not be true.<br>
Same effect with '1' = '1' .<br>
<br>
Maybe we can add a style function "true()" which always retrurns true for this?<br>
<br>
Gerd<br>
______________________________<wbr>__________<br>
Von: mkgmap-dev <<a href="mailto:mkgmap-dev-bounces@lists.mkgmap.org.uk">mkgmap-dev-bounces@lists.<wbr>mkgmap.org.uk</a>> im Auftrag von Ticker Berkin <<a href="mailto:rwb-mkgmap@jagit.co.uk">rwb-mkgmap@jagit.co.uk</a>><br>
Gesendet: Mittwoch, 8. März 2017 09:25:34<br>
<div class="HOEnZb"><div class="h5">An: <a href="mailto:mkgmap-dev@lists.mkgmap.org.uk">mkgmap-dev@lists.mkgmap.org.uk</a><br>
Betreff: Re: [mkgmap-dev] if-then-else in style and style options<br>
<br>
Hi<br>
<br>
I think you should document that you need a dummy condition, ie<br>
<br>
if (...) then<br>
1=1 {action}<br>
...<br>
1=1 [0x1c ...]<br>
end<br>
<br>
(I assume this should work OK)<br>
<br>
Ticker<br>
<br>
On Wed, 2017-03-08 at 08:07 +0000, Gerd Petermann wrote:<br>
> Hi all,<br>
><br>
> while writing the documentation I noticed this possible problem case:<br>
> The lines file in the default style contains these rules:<br>
> boundary=administrative { name '${mkgmap:boundary_name}' }<br>
> boundary=administrative & admin_level<3 [0x1e resolution 12]<br>
> boundary=administrative & admin_level<5 [0x1d resolution 19]<br>
> boundary=administrative & admin_level<7 [0x1c resolution 21]<br>
> boundary=administrative & admin_level<9 [0x1c resolution 22]<br>
> boundary=administrative [0x1c resolution 22]<br>
><br>
> So, one may want to extract the clause boundary=administrative like<br>
> this:<br>
> if (boundary=administrative) then<br>
> { name '${mkgmap:boundary_name}' }<br>
> admin_level<3 [0x1e resolution 12]<br>
> admin_level<5 [0x1d resolution 19]<br>
> admin_level<7 [0x1c resolution 21]<br>
> admin_level<9 [0x1c resolution 22]<br>
> [0x1c resolution 22]<br>
> end<br>
><br>
> The problem: It doesn't work because the lines<br>
> { name '${mkgmap:boundary_name}' }<br>
> and<br>
> [0x1c resolution 22]<br>
> are not a valid rules and the rule parser "forgets" that the<br>
> boundary=administrative expression will be added.<br>
><br>
> What do you think? Should mkgmap support this syntax?<br>
><br>
> Gerd<br>
> ______________________________<wbr>__________<br>
> Von: mkgmap-dev <<a href="mailto:mkgmap-dev-bounces@lists.mkgmap.org.uk">mkgmap-dev-bounces@lists.<wbr>mkgmap.org.uk</a>> im Auftrag<br>
> von Gerd Petermann <<a href="mailto:GPetermann_muenchen@hotmail.com">GPetermann_muenchen@hotmail.<wbr>com</a>><br>
> Gesendet: Dienstag, 7. März 2017 20:10:52<br>
> An: Development list for mkgmap<br>
> Betreff: Re: [mkgmap-dev] if-then-else in style and style options<br>
><br>
> Hi Andrzej,<br>
><br>
> thanks, so I'll try to document the new syntax next.<br>
><br>
> Gerd<br>
> ______________________________<wbr>__________<br>
> Von: mkgmap-dev <<a href="mailto:mkgmap-dev-bounces@lists.mkgmap.org.uk">mkgmap-dev-bounces@lists.<wbr>mkgmap.org.uk</a>> im Auftrag<br>
> von Andrzej Popowski <<a href="mailto:popej@poczta.onet.pl">popej@poczta.onet.pl</a>><br>
> Gesendet: Dienstag, 7. März 2017 17:40:16<br>
> An: <a href="mailto:mkgmap-dev@lists.mkgmap.org.uk">mkgmap-dev@lists.mkgmap.org.uk</a><br>
> Betreff: Re: [mkgmap-dev] if-then-else in style and style options<br>
><br>
> Hi Gerd,<br>
><br>
> I have run some tests with current code and spotted no problems. I<br>
> have<br>
> tested both, if-then-else statement and style-option.<br>
><br>
> --<br>
> Best regards,<br>
> Andrzej<br>
> ______________________________<wbr>_________________<br>
> mkgmap-dev mailing list<br>
> <a href="mailto:mkgmap-dev@lists.mkgmap.org.uk">mkgmap-dev@lists.mkgmap.org.uk</a><br>
> <a href="http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev" rel="noreferrer" target="_blank">http://www.mkgmap.org.uk/<wbr>mailman/listinfo/mkgmap-dev</a><br>
> ______________________________<wbr>_________________<br>
> mkgmap-dev mailing list<br>
> <a href="mailto:mkgmap-dev@lists.mkgmap.org.uk">mkgmap-dev@lists.mkgmap.org.uk</a><br>
> <a href="http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev" rel="noreferrer" target="_blank">http://www.mkgmap.org.uk/<wbr>mailman/listinfo/mkgmap-dev</a><br>
> ______________________________<wbr>_________________<br>
> mkgmap-dev mailing list<br>
> <a href="mailto:mkgmap-dev@lists.mkgmap.org.uk">mkgmap-dev@lists.mkgmap.org.uk</a><br>
> <a href="http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev" rel="noreferrer" target="_blank">http://www.mkgmap.org.uk/<wbr>mailman/listinfo/mkgmap-dev</a><br>
______________________________<wbr>_________________<br>
mkgmap-dev mailing list<br>
<a href="mailto:mkgmap-dev@lists.mkgmap.org.uk">mkgmap-dev@lists.mkgmap.org.uk</a><br>
<a href="http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev" rel="noreferrer" target="_blank">http://www.mkgmap.org.uk/<wbr>mailman/listinfo/mkgmap-dev</a><br>
______________________________<wbr>_________________<br>
mkgmap-dev mailing list<br>
<a href="mailto:mkgmap-dev@lists.mkgmap.org.uk">mkgmap-dev@lists.mkgmap.org.uk</a><br>
<a href="http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev" rel="noreferrer" target="_blank">http://www.mkgmap.org.uk/<wbr>mailman/listinfo/mkgmap-dev</a><br>
</div></div></blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr">Dave Swarthout<br>Homer, Alaska<br>Chiang Mai, Thailand<br>Travel Blog at <a href="http://dswarthout.blogspot.com" target="_blank">http://dswarthout.blogspot.com</a></div></div>
</div>