How do I write printf("Content-type:%s\r\n\r\n",type)

L

Lampa Dario

Hello,

I hope I am not too OT.

How do I write printf("Content-type:%s\r\n\r\n",type) in Pascal ?

I am translating a library of mine written in C into Pascal. How do
I write \r\n\r\n in Pascal?
I tried with write(chr(13)+chr(10)+chr(10)+chr(13)), or
write(#13#10#13#10), but I always get "Premature end of script headers"

I need it to write a CGI program in FreePascal
Thanks in advance

Francesco
 
C

Chris Dollin

Lampa said:
Hello,

I hope I am not too OT.

How do I write printf("Content-type:%s\r\n\r\n",type) in Pascal ?

I'm afraid you are extremely off-topic.

Ask in the appropriate Pascal group, since it's a question about Pascal.
 
D

Dave Vandervies

Hello,

I hope I am not too OT.

How do I write printf("Content-type:%s\r\n\r\n",type) in Pascal ?

We can help you with understanding the C bit here, though it seems like
you already know what it's doing, so that won't get you any farther.

You want the people who know Pascal. They (even the ones who also know
C and also read here) are best found in a newsgroup that discusses Pascal.

comp.lang.pascal, if it exists, would be the first place I'd look.


dave
 
O

Old Wolf

Lampa said:
I hope I am not too OT.

This is a C group and you are asking a pascal question..
How do I write printf("Content-type:%s\r\n\r\n",type) in Pascal ?

I am translating a library of mine written in C into Pascal. How do
I write \r\n\r\n in Pascal?
I tried with write(chr(13)+chr(10)+chr(10)+chr(13)), or

Note that in C, \r\n\r\n is NOT necessarily equivalent to
13 10 13 10.

If you are in Windows, then printf("\r\n\r\n"); will get you
13 13 10 13 13 10, because text-mode streams apply conversions
to '\n' (ie. writing '\n' gives '\r\n', and reading '\r\n'
gets you '\n').
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,768
Messages
2,569,575
Members
45,053
Latest member
billing-software

Latest Threads

Top