Am Montag 22 März 2010 01:19:51 schrieben Sie:
> I have used <? ... ? ... ?> in my programs, though I more commonly use
> <{ reply.out() << ... ? ... : ... }> instead, as the lack of an "else"
> component to it is the primary limiting factor of it. I think this
> particular item would be a lot more useful if it could be represented as
> <? ... ? ... : ... ?>, and furthermore if a way could be found to nest
> these as you can with the traditional C++ ... ? ... : ... syntax, such
> that you could do something like...
>
> <? is_number_1(a) ? 1 : 0 ?>
What you want is:
<$ is_number_1(a) ? 1 : 0 $>
>
> And that would print 1 if it's number 1 or 0 if it's not. The more
> difficult one would be the nesting... something like...
>
> <? is_number_1(a) ? 1 : <? is_number_2(a) ? 2 : 0 ?> ?>
>
And you can nest it also:
<$ is_number_1(a) ? 1 : is_number_2(a) ? 2 : 0 $>
These <$...$> tags print a C++-Expression to the page. The idea, why I made <?
... ? ... ?> is just because sometimes I do not have an else case. And it is
just boaring to print something empty to the page like:
<$ someCondition ? "Hello" : "" $>.
Tommi
------------------------------------------------------------------------------
Download Intel® Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
Tntnet-general mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/tntnet-general