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

Discussion in 'C Programming' started by Lampa Dario, Sep 9, 2005.

  1. Lampa Dario

    Lampa Dario Guest

    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
    --
    Teaching OnLine
    Corsi online di programmazione
    Php, Asp, C, C++, Visual Basic, Delphi
    Linux Shell Programming
    ------------------------------------
    http://www.teachingonline.it
    Lampa Dario, Sep 9, 2005
    #1
    1. Advertising

  2. Lampa Dario

    Chris Dollin Guest

    Lampa Dario wrote:

    > 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.

    --
    Chris "electric hedgehog" Dollin
    Logic is rational /re/construction. Life is construction.
    Chris Dollin, Sep 9, 2005
    #2
    1. Advertising

  3. In article <OahUe.33400$>,
    Lampa Dario <> wrote:
    >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

    --
    Dave Vandervies
    Not only has Richard done something *useful* for the C community,
    his worth is measured in pence and pounds, not dimes and dollars.
    --Chris Dollin in comp.lang.c
    Dave Vandervies, Sep 9, 2005
    #3
  4. Lampa Dario

    Old Wolf Guest

    Lampa Dario wrote:
    >
    > 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').
    Old Wolf, Sep 10, 2005
    #4
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Peter Hansen
    Replies:
    1
    Views:
    384
    Joona I Palaste
    Aug 24, 2003
  2. Peter Hansen
    Replies:
    1
    Views:
    418
    Joona I Palaste
    Aug 24, 2003
  3. ben
    Replies:
    4
    Views:
    615
    Martin Ambuhl
    Jun 26, 2004
  4. whatluo

    (void) printf vs printf

    whatluo, May 26, 2005, in forum: C Programming
    Replies:
    29
    Views:
    1,240
  5. azza

    printf affects following printf/s

    azza, Oct 17, 2010, in forum: C Programming
    Replies:
    0
    Views:
    431
Loading...

Share This Page