Am 02.04.2012 09:36, schrieb Oliver Rath:
> Hi List,
>
> its alwasy the same: You write your thoughts in a message for the list
> and then, _after_ sending, youve got the righte idea:
>
> Changing the mimetype to text/plan was the right choice:
>
> ---------------- snip -----------------------------
> <%pre>
> </%pre>
> <%args>
> </%args>
> <%cpp>
> reply.setContentType("text/plain");
> </%cpp>
> #!/bin/bash
> echo Please choose a menu item
> echo from the following points
> read
> exit
> ---------------- snip ----------------------------
>
> Now the right result comes in the browser :-)
>
> IMPORTANT NOTE: If you putting some empty lines in your ecpp-code (i.e. for 
> structuring) between the declaration areas, these line are sent in the 
> beginning of the file. Normally, this doesnt matter, but if you want to 
> execute the file (here: a bash script), the leading empty lines prevent 
> execution, because the needed shabang "#!" isnt in the first line as needed, 
> so this wont work:
>
> ---------------- snip -----------------------------
> <%pre>
> </%pre>
>
> <%args>
> </%args>
>
> # here a empty line for better reading destroys "executionability" of script
> <%cpp>
> reply.setContentType("text/plain");
> </%cpp>
> #!/bin/bash
> echo Please choose a menu item
> echo from the following points
> read
> exit
> ---------------- snip ----------------------------
>
> @Tommi: Maybe you want to enhance tntnet the stuctruring text wont be sent. 
> I.e. you could implement another tag in the kind of<%output>  and</%output>  
> or<%html>  </%html>  for starting the html-area?
>
> Regards,
> Oliver
>
>
>
> ------------------------------------------------------------------------------
> This SF email is sponsosred by:
> Try Windows Azure free for 90 days Click Here
> http://p.sf.net/sfu/sfd2d-msazure
> _______________________________________________
> Tntnet-general mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/tntnet-general
There is one special feature for that. Line feeds after these <%..>-tags 
are not printed. Therefore you can write like you wrote in your first 
example. This is the only special rule. Everything outside these special 
tags are just output to the page. I know about that "problem", that it 
is too easy to output empty lines. If you have some space between the 
tags, you can put a percent sign between the tags like this:

<%pre>
</%pre>
%
<%cpp>

<%/cpp>

Since a percent sign in the first column starts a one line C++-block, 
there is nothing to output to the page. The problem with <%output> or 
something is, that a ordinary html page is no ecpp page any more. You 
always have to put these tags into the page to get some output. I don't 
think, that this is a good idea.

Tommi

------------------------------------------------------------------------------
This SF email is sponsosred by:
Try Windows Azure free for 90 days Click Here 
http://p.sf.net/sfu/sfd2d-msazure
_______________________________________________
Tntnet-general mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/tntnet-general

Reply via email to