Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-pascal / 2006-05

writeln in fpc 2.0.2

6 messages · 3 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

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 .

Reply by email

Marco van de Voort
to Gustavo Enrique Jimenez
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.

Reply by email

Michael Van Canneyt
to Gustavo Enrique Jimenez: I use Lazarus. So, I've upgraded fpc from 1.0.10 to 2.0.2 . I've recompiled my cgi…
Gustavo Enrique Jimenez wrote 24 lines
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.

Reply by email

Gustavo Enrique Jimenez
to Gustavo Enrique Jimenez: ok ! I will remove crt references. Sorry for not read the docs !!!! Thank you very much…
> 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 !!!

Reply by email

Michael Van Canneyt
to Gustavo Enrique Jimenez
Gustavo Enrique Jimenez wrote 9 lines
> > 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.

Reply by email