Code Comments
Programming Forum and web based access to our favorite programming groups.I understand that there is an interface program available from Liant. But is there a more general solution? I use Tiny Cobol and sometimes Open Cobol. -- John Culleton Able Indexers and Typesetters
Post Follow-up to this message"John Culleton" <john@wexfordpress.com> wrote in message news:ab2dnXJ3h8OjMYDeRVn-og@adelphia.com... >I understand that there is an interface program available from Liant. But >is > there a more general solution? I use Tiny Cobol and sometimes Open Cobol. See the responses made to your other post on the same topic: you can interface with the web server via the command line arguments, environment variables and standard out. - Oliver
Post Follow-up to this message> is there a more general solution? The standard CGI mechanism from many web servers only requires the use of stdin, stdout and environment variables. These can be accessed in many Cobol versions. I have had the same Cobol code (with a handful of different lines) run on OS/2 with an IBM server, Windows with PWS and Xitami server, Linux with Apache, SCO with Netscape. It even ran using a DOS based (DR-Multiuser-DOS) server and one that ran on Windows 3.x. With standard CGI most stuff is passed as environment variables and the message may be in QUERY_STRING or you may need to accept to get it from stdin. The trick is to ensure that only the length specified in CONTENT_LENGTH is accepted otherwise the program will hang (depending on compiler version). You need to process the input because, for example, spaces will arrive as %20 and the form field will be strung as name=value&name2=value2. For ouput just display to stdout. You _NEED_ to display a mime header "Content-type: text/html" _AND_ _TWO_ _LINEFEEDS_. Otherwise you will get nothing at all. The rest is just html. I use a templating method to do output. The program makes up an array of field-name, field-value pairs and passes this to a templating module which reads the template text and substitutes the field-value whereever it sees a <!%field-name%>. This means that I can change the page without having to recompile, or even just output XML, or plain text, or postscript, or CSV, or ... Just read a book on CGI and code it up.
Post Follow-up to this messagePowered by vBulletin
Copyright 2000-2006 Jelsoft Enterprises Limited.