From af6388f2f742160a718b320585ac8d3256f03608 Mon Sep 17 00:00:00 2001 From: Eddie Runia Date: Tue, 27 Jul 1999 05:58:40 +0000 Subject: [PATCH] see changelog --- harbour/ChangeLog | 8 ++++ harbour/tests/working/hscript/dir.hs | 15 ++++---- harbour/tests/working/hscript/hello.hs | 9 ++--- harbour/tests/working/hscript/hscript.prg | 45 +++++++++++++---------- harbour/tests/working/hscript/multiply.hs | 11 +++--- harbour/tests/working/hscript/ugly.hs | 6 +-- harbour/tests/working/testcgi.prg | 9 ++++- 7 files changed, 60 insertions(+), 43 deletions(-) diff --git a/harbour/ChangeLog b/harbour/ChangeLog index 67fb96b7f8..484e35cd8a 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -1,3 +1,11 @@ +19990727-07:50 CET Felipe Coury + * tests/working/hscript/dir.hs; tests/working/hscript/hello.hs; + tests/working/hscript/hscript.prg; tests/working/hscript/multiply.hs; + tests/working/hscript/ugly.hs + New version + * tests/working/testcgi.prg + New version as well + 19990727-06:12 GMT+1 Antonio Linares * makefile.b32 + Added inkey.c module diff --git a/harbour/tests/working/hscript/dir.hs b/harbour/tests/working/hscript/dir.hs index 8908c57ce2..8237c8457d 100644 --- a/harbour/tests/working/hscript/dir.hs +++ b/harbour/tests/working/hscript/dir.hs @@ -10,9 +10,8 @@ FUNCTION Main() LOCAL i IF !empty( GetEnv( "SERVER_NAME" ) ) - qqOut( "HTTP/1.0 200 OK" ) - qOut( "CONTENT-TYPE: TEXT/HTML" ) - qOut( "" ) + OutStd( "HTTP/1.0 200 OK" + chr(10) ) + OutStd( "CONTENT-TYPE: TEXT/HTML" + chr(10) + chr(10) ) ENDIF aSort( aDir,,, { |x, y| x[1] < y[1] } ) @@ -33,11 +32,11 @@ FUNCTION Main() FOR i := 1 TO len( aDir ) %> -<% qOut( aDir[i,1] ) %> -<% qOut( aDir[i,2] ) %> -<% qOut( aDir[i,3] ) %> -<% qOut( aDir[i,4] ) %> -<% qOut( aDir[i,5] ) %> +<% OutStr( aDir[i,1] ) %> +<% OutStr( aDir[i,2] ) %> +<% OutStr( aDir[i,3] ) %> +<% OutStr( aDir[i,4] ) %> +<% OutStr( aDir[i,5] ) %> <% NEXT diff --git a/harbour/tests/working/hscript/hello.hs b/harbour/tests/working/hscript/hello.hs index c02d5009d8..529b80ddc5 100644 --- a/harbour/tests/working/hscript/hello.hs +++ b/harbour/tests/working/hscript/hello.hs @@ -13,9 +13,8 @@ FUNCTION Main() // Add content-type parameter if using active page on a Web Server IF !empty( GetEnv( "SERVER_NAME" ) ) - qqOut( "HTTP/1.0 200 OK" ) - qOut( "CONTENT-TYPE: TEXT/HTML" ) - qOut( "" ) + OutStd( "HTTP/1.0 200 OK" + chr(10) ) + OutStd( "CONTENT-TYPE: TEXT/HTML" + chr(10) + chr(10) ) ENDIF %> @@ -28,11 +27,11 @@ FUNCTION Main() <% // Now saying hello to the world in 3 different ways: // 1. Pure harbour: - qOut( "

Hello world!

" ) + OutStd( "

Hello world!

" ) // 2. Hybrid harbour-html: %> -

<% qOut( "Hello world!" ) %>

+

<% OutStd( "Hello world!" ) %>

<% // 3. Pure html: %> diff --git a/harbour/tests/working/hscript/hscript.prg b/harbour/tests/working/hscript/hscript.prg index 874c62cd7b..d0a52dee14 100644 --- a/harbour/tests/working/hscript/hscript.prg +++ b/harbour/tests/working/hscript/hscript.prg @@ -1,5 +1,5 @@ /* -* +* $Id$ * * HScript.PRG * HarbourScript translation engine @@ -32,12 +32,17 @@ * * 1999/06/13 First implementation. * 1999/06/24 Enhanced tag matching routines. +* 1999/07/26 Corrections to CGI output, qOut() -> OutStd(). * **/ #include "CGI.ch" #define IF_BUFFER 65535 -#define NewLine chr(13)+chr(10) +#ifdef __HARBOUR__ +#define NewLine chr(10) +#else +#define NewLine chr(13) +#endif FUNCTION Main( cScript ) @@ -54,29 +59,30 @@ FUNCTION Main( cScript ) IF empty( GetEnv( "SERVER_NAME" ) ) cScriptName := cScript - cLocation := GetEnv( "PATH_TRANSLATED" ) + ; - strtran( GetEnv( "SCRIPT_NAME" ), "/", "\" ) - cLocation := substr( cLocation, 1, rat( "\", cLocation ) ) - cHarbourDir := cLocation + cLocation := cHarbourDir ELSE cScriptName := GetEnv( "QUERY_STRING" ) IF at( "=", cScriptName ) != 0 cScriptName := ParseString( cScriptName, "=", 2 ) ENDIF + cLocation := GetEnv( "PATH_TRANSLATED" ) + ; + strtran( GetEnv( "SCRIPT_NAME" ), "/", "\" ) + cLocation := substr( cLocation, 1, rat( "\", cLocation ) ) + cHarbourDir := cLocation ENDIF IF empty( cScriptName ) IF !empty( GetEnv( "SERVER_NAME" ) ) - qqOut( "content-type: text/html" ) - qOut( "" ) - qOut( "

Server Error

" ) - qOut( "Must specify scriptname using hscript.exe?script=" ) - qOut( "" ) + OutStd( "content-type: text/html" + NewLine ) + OutStd( NewLine ) + OutStd( "

Server Error

" + NewLine ) + OutStd( "Must specify scriptname using hscript.exe?script=" + NewLine ) + OutStd( "" + NewLine ) ELSE - qOut( "Please give .hs name" ) + OutStd( "Please give .hs name" + NewLine ) ENDIF @@ -86,9 +92,9 @@ FUNCTION Main( cScript ) // Script not found IF !file( cScriptName ) IF !empty( GetEnv( "SERVER_NAME" ) ) - qqOut( "CONTENT-TYPE: text/html" ) + OutStd( "CONTENT-TYPE: text/html" + NewLine ) ENDIF - qOut( "

Server Error

Script not found: " + cScriptName ) + OutStd( "

Server Error

Script not found: " + cScriptName + NewLine ) EXIT ENDIF @@ -101,7 +107,7 @@ FUNCTION Main( cScript ) nLen := len( cLine ) IF lOpen - cTrans += "qOut( '" + cTrans += "OutStd( '" ENDIF FOR i := 1 TO nLen @@ -119,7 +125,7 @@ FUNCTION Main( cScript ) cTrans += NewLine ENDIF IF i + 1 < nLen - cTrans += "qOut( '" + cTrans += "OutStd( '" ENDIF lOpen := .t. @@ -132,7 +138,7 @@ FUNCTION Main( cScript ) ELSE // Fecha script - cTrans += "' )" + cTrans += "' + chr(10) )" lOpen := .f. IF i < nLen // cTrans += " ; " @@ -150,7 +156,7 @@ FUNCTION Main( cScript ) NEXT IF lOpen .AND. substr( cLine, nLen - 1, 2 ) <> "%>" - cTrans += "' )" + cTrans += "' + chr(10) )" ENDIF aadd( aResult, cTrans ) @@ -168,7 +174,8 @@ FUNCTION Main( cScript ) fClose( hFile ) // Creates the temporary HRB, erases the PRG - __Run( cHarbourDir + "harbour.exe " + cFile + " /q /n /gHRB" ) + __Run( cHarbourDir + "harbour.exe " + cFile + " /q /n /gHRB /o" + ; + left( cHarbourDir, len( cHarbourDir ) - 1 ) ) fErase( cFile ) // Runs using Tugboat diff --git a/harbour/tests/working/hscript/multiply.hs b/harbour/tests/working/hscript/multiply.hs index 1beefc8e87..0b2d8cb3b4 100644 --- a/harbour/tests/working/hscript/multiply.hs +++ b/harbour/tests/working/hscript/multiply.hs @@ -14,9 +14,8 @@ FUNCTION Main() LOCAL i, j IF !empty( GetEnv( "SERVER_NAME" ) ) - qqOut( "HTTP/1.0 200 OK" ) - qOut( "CONTENT-TYPE: TEXT/HTML" ) - qOut( "" ) + OutStd( "HTTP/1.0 200 OK" + chr(10) ) + OutStd( "CONTENT-TYPE: TEXT/HTML" + chr(10) + chr(10) ) ENDIF %> @@ -24,7 +23,7 @@ FUNCTION Main() Testing script -

<% qOut( "Teste de HarbourScript!" ) %>

+

<% OutStd( "HarbourScript Test!" ) %>

<% @@ -36,8 +35,8 @@ FUNCTION Main() FOR j := 1 TO 10 %> -<% qOut( str( i, 2 ) + " x " + str( j, 2 ) ) %> -<% qOut( i*j ) %> +<% OutStd( str( i, 2 ) + " x " + str( j, 2 ) ) %> +<% OutStd( i*j ) %> <% NEXT diff --git a/harbour/tests/working/hscript/ugly.hs b/harbour/tests/working/hscript/ugly.hs index c0174f80b3..18c0961359 100644 --- a/harbour/tests/working/hscript/ugly.hs +++ b/harbour/tests/working/hscript/ugly.hs @@ -6,11 +6,11 @@ */ LOCAL a := "Hello Mom!" %><% - qOut( a ) %>

This is a very ugly script!!!<% - qOut( "Line 2" ) + OutStd( a ) %>

This is a very ugly script!!!<% + OutStd( "Line 2" ) %>

<% -qOut( a, a, a ) +OutStd( a, a, a ) %> <%RETURN( NIL )%> diff --git a/harbour/tests/working/testcgi.prg b/harbour/tests/working/testcgi.prg index cc0c1df1b8..e758a83aee 100644 --- a/harbour/tests/working/testcgi.prg +++ b/harbour/tests/working/testcgi.prg @@ -21,12 +21,17 @@ * (See http://www.flexsys-ci.com/harbour-project/functions.htm) * 1999/06/11 List can be viewed online at * http://www.flexsys-ci.com/cgi-bin/testcgi.exe +* 1999/07/29 Changed qOut() calls to OutStd() calls. * **/ #include "cgi.ch" #define IF_BUFFER 65535 -#define NewLine chr(10)+chr(13) +#ifdef __HARBOUR__ +#define NewLine chr(10) +#else +#define NewLine chr(13) +#endif FUNCTION Main() @@ -320,7 +325,7 @@ STATIC FUNCTION ShowResult() LOCAL Self := QSelf() - qqOut( ; + OutStd( ; "HTTP/1.0 200 OK" + NewLine + ; "CONTENT-TYPE: TEXT/HTML" + NewLine + NewLine + ; ::cContent )