I want to know - Programmers Heaven

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

I want to know

Augie1300Augie1300 Posts: 2Member
I wanted to know if you could put your pascal program on a webpage. If you can can someone please tell me how?Im new to pascal please help!

Comments

  • zibadianzibadian Posts: 6,349Member
    : I wanted to know if you could put your pascal program on a webpage. If you can can someone please tell me how?Im new to pascal please help!
    :
    Depends on what you mean by put a Pascal program on a webpage. If you want people to be able to download and run your program on their system, it is easily done in that same way as an image or a zip file (I would recommend to zip it in regards with download times).
    If you want to be able to run the program as part of your webpage (i.e. a Pascal CGI script), then things are a lot more complicated. You'll need to have the correct webserver, code the program in such a way that it becomes a cgi-program instead of a normal DOS program, and your hosting service needs to allow you to place cgi scripts on your page.
  • ManningManning Posts: 1,621Member
    : : I wanted to know if you could put your pascal program on a webpage. If you can can someone please tell me how?Im new to pascal please help!
    : :
    : Depends on what you mean by put a Pascal program on a webpage. If you want people to be able to download and run your program on their system, it is easily done in that same way as an image or a zip file (I would recommend to zip it in regards with download times).
    : If you want to be able to run the program as part of your webpage (i.e. a Pascal CGI script), then things are a lot more complicated. You'll need to have the correct webserver, code the program in such a way that it becomes a cgi-program instead of a normal DOS program, and your hosting service needs to allow you to place cgi scripts on your page.
    :


    There really isnt anything special that needs to be done to make a CGI. Any webserver Ive ever used captures anything you write to STDOUT, so simply calling WriteLn() will have your text displayed in the web-page.

    The only thing that may be required is to do:

    WriteLn('Content-type: text/html');
    WriteLn;

    Before writing anything else. And one limitation is that if you use the CRT unit the webserver won't see any text you write. But for a CGI there's no need for that unit anyway.

    And I've never tried a 16bit DOS program so I dont know how well/if that would work, but win32 console applications work fine.
  • Augie1300Augie1300 Posts: 2Member
    : : : I wanted to know if you could put your pascal program on a webpage. If you can can someone please tell me how?Im new to pascal please help!
    : : :
    : : Depends on what you mean by put a Pascal program on a webpage. If you want people to be able to download and run your program on their system, it is easily done in that same way as an image or a zip file (I would recommend to zip it in regards with download times).
    : : If you want to be able to run the program as part of your webpage (i.e. a Pascal CGI script), then things are a lot more complicated. You'll need to have the correct webserver, code the program in such a way that it becomes a cgi-program instead of a normal DOS program, and your hosting service needs to allow you to place cgi scripts on your page.
    : :
    :
    :
    : There really isnt anything special that needs to be done to make a CGI. Any webserver Ive ever used captures anything you write to STDOUT, so simply calling WriteLn() will have your text displayed in the web-page.
    :
    : The only thing that may be required is to do:
    :
    : WriteLn('Content-type: text/html');
    : WriteLn;
    :
    : Before writing anything else. And one limitation is that if you use the CRT unit the webserver won't see any text you write. But for a CGI there's no need for that unit anyway.
    :
    : And I've never tried a 16bit DOS program so I dont know how well/if that would work, but win32 console applications work fine.
    :k, thanks alot.

Sign In or Register to comment.