Den 3 Jan 2000 skrev Colin Burroughs:
> Hi,
>
> Check this out under Orion 0.8.1 on NT inside JSP.
>
> <%
> for(int i=0;i>-21;i--) {
> out.print(i+"");
> }
> out.print("<br>");
> for(int i=0;i>-21;i--) {
> out.print(i);
> }
> %>
>
> ....the only difference is the empty string appended to the int value in the first
>loop! The first loop works as expected:
>
> 0-1-2-3-4-5-6-7-8-9-10-11-12-13-14-15-16-17-18-19-20
>
> ..but the second loop returns:
>
> 0/.-,+*)('0/.-,+*)('0
>
> The actual values of the int is correct because you can still test its value, but it
>sure looks unhealthy when you try and flush it to the output stream... (Unless you
>want to append an empty string to it!!)
It's pretty simple. There is a write() method that accepts an integer and parses it as
a number (which is the unicode value of the character to be written). If you "add" the
empty string to the number the result is a conversion to a string with results in a
different "write" method call (one that writes a string to the output stream).