writeln in fpc 2.0.2

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

writeln in fpc 2.0.2

Gustavo Enrique Jimenez
 I use Lazarus. So, I've upgraded fpc from 1.0.10  to 2.0.2  .

I've recompiled my cgi apps, and now something is wrong: lines with
more than 80 char writed with writeln seems to be "truncated" at
position 80. A #10 char follows, an then the rest of the line.

If I send the output to a text file, calling my app within a console,
lines seems to be ok (they are not "truncated"). But when I see the
source code of the html page returned by my cgi app, they are
truncated.

is it possible tha writeln is "truncating" lines with more than 80
chars, adding an extra #10 char in byte 80 ?

My system is : fpc 2.0.2, Debian Sarge on pentium.

Thanks in advance !! (excuse my english)


Gustavo Enrique Jiménez

ps: Deep in the code, it is possible that crt unit is still linked
(the cgi app comes from an old turbopascal console app). Also, I use
oldlinux unit instead of baseunix, unix, linux units .
_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: writeln in fpc 2.0.2

Marco van de Voort
> ps: Deep in the code, it is possible that crt unit is still linked
> (the cgi app comes from an old turbopascal console app).

I think this is the primary problem, in combination with your terminal
emulator and/or settings.

- What do you use for console?
- Some X program like xterm or gnomeconsole, or did
        you do the tests in textmode?
- What are your terminal settings ? (COLUMNS and TERM environment variables)

And most importantly, if you already expect crt to be the problem, why don't
you eliminate it?

> Also, I use
> oldlinux unit instead of baseunix, unix, linux units .

While not recommended, I don't expect this to be related or likely,
specially if you already mention there is a remote possibility that you use
a console take-over unit like Crt.
_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: writeln in fpc 2.0.2

Michael Van Canneyt
In reply to this post by Gustavo Enrique Jimenez


On Tue, 30 May 2006, Gustavo Enrique Jimenez wrote:

> I use Lazarus. So, I've upgraded fpc from 1.0.10  to 2.0.2  .
>
> I've recompiled my cgi apps, and now something is wrong: lines with
> more than 80 char writed with writeln seems to be "truncated" at
> position 80. A #10 char follows, an then the rest of the line.
>
> If I send the output to a text file, calling my app within a console,
> lines seems to be ok (they are not "truncated"). But when I see the
> source code of the html page returned by my cgi app, they are
> truncated.
>
> is it possible tha writeln is "truncating" lines with more than 80
> chars, adding an extra #10 char in byte 80 ?
>
> My system is : fpc 2.0.2, Debian Sarge on pentium.
>
> Thanks in advance !! (excuse my english)
>
>
> Gustavo Enrique Jiménez
>
> ps: Deep in the code, it is possible that crt unit is still linked
> (the cgi app comes from an old turbopascal console app). Also, I use
> oldlinux unit instead of baseunix, unix, linux units .
You MUST remove the CRT unit.
It's mentioned explicitly in the documentation that you are not allowed to use it for CGI.

Michael.
_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: writeln in fpc 2.0.2

Gustavo Enrique Jimenez
> You MUST remove the CRT unit.
> It's mentioned explicitly in the documentation that you are not allowed to use it for CGI.
>

ok !

I will remove crt references.

Sorry for not read the docs !!!!

Thank you very much (Marco and Michael)... !!!!

Gustavo Enrique Jiménez
_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: writeln in fpc 2.0.2

Gustavo Enrique Jimenez
> > You MUST remove the CRT unit.
> > It's mentioned explicitly in the documentation that you are not allowed to use it for CGI.
> >
>

I've removed all crt references. My cgi app works perfectly now. As an
unexpected  side effect, this app works perfectly also with Apache for
windows.

Thank you, thank you, thank you. I am VERY HAPPY with freepascal... !

Gustavo Enrique Jiménez

ps: every time I change the compiler, my apps get better and better.
Bugs shows up, and I have to split my units in core functions, gui
functions and OS specific functions. This is very good for
multiplatform programming.

FreePascal is not only a great programming tool. It is a also a great
LEARNING tool !!!
_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: writeln in fpc 2.0.2

Michael Van Canneyt


On Tue, 30 May 2006, Gustavo Enrique Jimenez wrote:

>> > You MUST remove the CRT unit.
>> > It's mentioned explicitly in the documentation that you are not allowed
>> to use it for CGI.
>> >
>>
>
> I've removed all crt references. My cgi app works perfectly now. As an
> unexpected  side effect, this app works perfectly also with Apache for
> windows.

This effect is not so unexpected. The main reason we put the remark in
the documentation is exactly so it would work with Apache :-)

Michael.
_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal