clarion prog as a cgi prog 
Author Message
 clarion prog as a cgi prog

does it's possible to use a cw program as a cgi program for internet
--
TRLOET S.



Fri, 08 Jan 1999 03:00:00 GMT  
 clarion prog as a cgi prog

Quote:
> does it's possible to use a cw program as a cgi program for internet

This has been discussed before.  Yes you can.  

1)  Use the report template and print the report to an ASCII text file.
 Then copy that text file to the console ('CON' device).  This is
very slow but works.

2)  Use the API _lwrite() call to write directly to the special console
file handle 1.  This is very fast,  but you need to loop through the
records in your report manually.

Here is the 16-bit sample,

  MAP
    MODULE('api')
      _lwrite(ushort,*cstring,ushort),ushort,raw,Pascal
    END
    CGI_write(string)
  END  

CGI_write  PROCEDURE(theText)
myLine  CSTRING(80)
  CODE
    myLine = clip(theText) & chr(13) & chr(10)
    _lwrite(1, myline, len(myline))
  END

  CODE
    cgi_Write('<HTML>')
     cgi_Write('<HEAD>')
      cgi_write('<TITLE>Sample HTML document from Clarion')
     cgi_Write('</HEAD>')
     cgi_Write('<BODY>')
      cgi_write('<H1>Sample HTML document from Clarion</H1><BR>')
      cgi_write('<TABLE BORDER>')
       cgi_write('<TR>')
        cgi_write('<TD>Surname'
        cgi_write('<TD>First name')
        cgi_write('<TD>Salary')
        cgi_write('<TD>Date of birth')
       cgi_write('</TR>')

       Set(Person,per:alpha_key)
       Loop
         Next(Person)
         If ErrorCode() then break .

         cgi_write('<TR>')
          cgi_write('<TD>' & clip(per:surname))
          cgi_write('<TD>' & clip(per:firstname))


         cgi_write('</TR>')
       End
      cgi_write('</TABLE>')
     cgi_Write('</BODY>')
    cgi_Write('</HTML>')

The above snippet of code is from an actual CW1.5 CGI program.  It runs
on a Windows 95 web server.

Fred Trter



Sun, 10 Jan 1999 03:00:00 GMT  
 clarion prog as a cgi prog

Hi Fred,

Quote:
>> does it's possible to use a cw program as a cgi program for internet
>This has been discussed before.  Yes you can.  
>1)  Use the report template and print the report to an ASCII text file.
> Then copy that text file to the console ('CON' device).  This is
>very slow but works.
>2)  Use the API _lwrite() call to write directly to the special console
>file handle 1.  This is very fast,  but you need to loop through the
>records in your report manually.
>Here is the 16-bit sample,

Is this by using the CGI or the WinCGI-standard. If CGI, how do you
get to the environment-variables that sets the useroptions ?
I've used the WinCGI-approach with CW, and found it to be quite easy
to implement, the speed isn't too bad either.

Cheers
Simen Bergsrud
Bates Digital



Sun, 10 Jan 1999 03:00:00 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Lit Prog - Meta Prog

2. Clarion file driver in multiuser prog.

3. Win 2000 - Clarion prog freeze

4. it their a way to convert a ASM prog, to a quick basic, visual basic prog????

5. C prog for cumulative normal dist translated into J

6. Position available: s/390 Assembler prog/analyst

7. My prog

8. Output from REXX directed to an ASSEMBLER prog

9. My prog

10. assembler prog'r

11. DOES ANYONE HAVE ANY LIN PROG CODE

12. ***SMALLTALK PROG. NEEDED IN CHICAGO****

 

 
Powered by phpBB® Forum Software