From db0d4e1b2e7fc4e3eb66c8bee544fb5e3422d781 Mon Sep 17 00:00:00 2001 From: Eddie Runia Date: Sat, 12 Jun 1999 07:37:52 +0000 Subject: [PATCH] see changelog --- harbour/ChangeLog | 7 + harbour/tests/working/function.cfm | 50 ++++++ harbour/tests/working/list.txt | 238 +++++++++++++++++++++++++++++ harbour/tests/working/testcgi.prg | 191 ++++++++++++++++++++--- 4 files changed, 464 insertions(+), 22 deletions(-) create mode 100644 harbour/tests/working/function.cfm create mode 100644 harbour/tests/working/list.txt diff --git a/harbour/ChangeLog b/harbour/ChangeLog index 73aeb48fc6..f285f1ac69 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -1,3 +1,10 @@ +19990612-08:30 CET Jose Lalin / Eddie Runia + * tests/working/testcgi.prg + New version uploaded. + ER : Changed HB_File -> File and Functions.cfm -> Function.cfm + + tests/working/list.txt, function.cfm + Referenced files added + 19990612-08:00 CET Eddie Runia * tests/working/debugtst.prg, tests/working/clasinit.prg, * tests/working/funcarr.prg, tests/working/objarr.prg, diff --git a/harbour/tests/working/function.cfm b/harbour/tests/working/function.cfm new file mode 100644 index 0000000000..5295b3df1e --- /dev/null +++ b/harbour/tests/working/function.cfm @@ -0,0 +1,50 @@ + + + + +Harbour function task list + + + + +

clouds.jpg (2615 bytes)

+ + + +

Function Task List +
In Portuguese

+ +

Below is a list of all Harbour +functions in the RTL and their current state. This list is +updated as changes are made to the library. This list is based on +Clipper 5.2. The legend is as follows:

+ +

Ready
+No more work needed on this function.

+ +

Started
+This function needs some work but will provide basic +functionality and can be used for testing.

+ +

Not Started
+This function has yet to be written.

+ + + + + + + + + + + + <#Functions> +
Function
Status
Ready
Started
Not Started
+ +

+

Last Update: April 28, 1999 + + + diff --git a/harbour/tests/working/list.txt b/harbour/tests/working/list.txt new file mode 100644 index 0000000000..695e83dff7 --- /dev/null +++ b/harbour/tests/working/list.txt @@ -0,0 +1,238 @@ +; +; The Harbour Project +; List.txt - Function Status List +; +; Syntax: +; ; +; +; Where: +; - [R]eady, [S]tarted, [N]ot Started +; +; Use ';' for comments +; +; Please review the following function status +; +; Updates: +; 1999.28.01 Status update for Bil's html file and Antonio's Mail List +; suggestions. New Matthew Hamilton updates. SET work has +; started! Now LIST.TXT is Y2K compatible (Thanks Jose!) +AADD;N +ABS;R +ACHOICE;N +ACLONE;N +ACOPY;N +ADEL;R +ADIR;N +AEVAL;N +AFIELDS;N +AFILL;R +AINS;N +ALERT;N +ALIAS;N +ALLTRIM;R +ALTD;N +ARRAY;R +ASC;R +ASCAN;R +ASIZE;S +ASORT;N +AT;R +ATAIL;S +BIN2I;R +BIN2L;R +BIN2W;R +BOF;N +BREAK;N +BROWSE;N +CDOW;N +CHR;R +CMONTH;N +COL;N +COLORSELECT;N +CTOD;S +CURDIR;N +DATE;N +DAY;S +DBAPPEND;S +DBCLEARFILTER;S +DBCLEARINDEX;S +DBCLEARRELATION;S +DBCLOSEALL;S +DBCLOSEAREA;S +DBCOMMIT;S +DBCOMMITALL;S +DBCREATE;S +DBCREATEIND;S +DBDELETE;S +DBEDIT;N +DBEVAL;S +DBF;N +DBFILTER;S +DBGOBOTTOM;S +DBGOTO;S +DBGOTOP;S +DBRECALL;S +DBREINDEX;S +DBRELATION;S +DBRSELECT;S +DBSEEK;S +DBSELECTAREA;S +DBSETDRIVER;S +DBSETFILTER;S +DBSETINDEX;S +DBSETORDER;S +DBSETRELATION;S +DBSKIP;S +DBSTRUCT;S +DBUNLOCK;S +DBUNLOCKALL;S +DBUSEAREA;S +DELETED;N +DESCEND;N +DEVOUT;N +DEVOUTPICT;N +DEVPOS;N +DIRECTORY;N +DISKSPACE;N +DISPBEGIN;N +DISPBOX;N +DISPCOUNT;N +DISPEND;N +DISPOUT;N +DOSERROR;N +DOW;N +DTOC;N +DTOS;N +EMPTY;S +EOF;N +ERRORBLOCK;N +ERRORLEVEL;N +EVAL;N +EXP;R +FCLOSE;S +FCOUNT;S +FCREATE;S +FERASE;S +FERROR;S +FIELDBLOCK;N +FIELDGET;S +FIELDNAME;S +FIELDPOS;S +FIELDPUT;S +FIELDWBLOCK;N +FILE;S +FKLABEL;N +FKMAX;N +FLOCK;N +FOPEN;S +FOUND;N +FREAD;S +FREADSTR;S +FRENAME;S +FSEEK;S +FWRITE;S +GETENV;N +HARDCR;N +HEADER;N +I2BIN;R +IF;R +INDEXEXT;N +INDEXKEY;N +INDEXORD;N +INKEY;N +INT;R +ISALPHA;R +ISCOLOR;N +ISDIGIT;R +ISLOWER;R +ISPRINTER;N +ISUPPER;R +L2BIN;R +LASTKEY;N +LASTREC;N +LEFT;S +LEN;R +LOG;R +LOWER;R +LTRIM;N +LUPDATE;N +MAX;R +MAXCOL;N +MAXROW;N +MEMOEDIT;N +MEMOLINE;N +MEMOREAD;N +MEMORY;N +MEMOTRAN;N +MEMOWRIT;N +MEMVARBLOCK;N +MIN;R +MLCOUNT;N +MLCTOPOS;N +MLPOS;N +MOD;N +MONTH;S +MPOSTOLC;N +NETERR;N +NETNAME;N +NEXTKEY;N +NOSNOW;N +OS;N +OUTERR;N +OUTSTD;R +PAD;R +PCOL;N +PCOUNT;N +PROCLINE;R +PROCNAME;R +PROW;N +QOUT;R +RAT;R +READEXIT;N +READINSERT;N +READKEY;N +READMODAL;N +READVAR;N +RECCOUNT;N +RECNO;N +RECSIZE;N +REPLICATE;R +RESTSCREEN;N +RIGHT;R +RLOCK;N +ROUND;N +ROW;N +RTRIM;R +SAVESCREEN;N +SCROLL;N +SECONDS;N +SELECT;S +SET;S +SETBLINK;N +SETCANCEL;N +SETCOLOR;N +SETCURSOR;N +SETKEY;N +SETMODE;N +SETPOS;N +SETPRC;N +SETPRC;N +SOUNDEX;N +SPACE;R +SQRT;R +STR;S +STRTRAN;R +STUFF;R +SUBSTR;R +TIME;N +TONE;N +TRANSFORM;S +TYPE;N +UPDATED;N +UPPER;R +USED;N +VAL;R +VALTYPE;R +VERSION;N +WORD;N +YEAR;S \ No newline at end of file diff --git a/harbour/tests/working/testcgi.prg b/harbour/tests/working/testcgi.prg index 3aea45653b..cbba4b8065 100644 --- a/harbour/tests/working/testcgi.prg +++ b/harbour/tests/working/testcgi.prg @@ -11,33 +11,80 @@ * * 1999/05/31 Initial CGI functionality. * 1999/06/01 Translated %nn to correct chars. +* 1999/06/02 Dynamic TAG matching routines (inspired on Delphi). +* First attempt to convert Delphi's ISAPI dll of WebSites' +* Function List +* (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 * **/ #include "CGI.ch" -#define NewLine chr(10)+chr(13) +#define IF_BUFFER 65535 +#define NewLine chr(10)+chr(13) FUNCTION Main() LOCAL oHTML := THTML():New() - LOCAL cName := "" + LOCAL hFile, nPos, cString, cBuf, i, cTable, cLine - cName := oHTML:QueryFields( "NAME" ) + oHTML:SetHTMLFile( "function.cfm" ) - oHTML:SetTitle( "Harbour CGI Scripting Demo" ) - oHTML:AddHead( "Harbour CGI Scripting DEMO" ) - oHTML:AddPara( "
    " + NewLine + ; - "
  • Name: " + oHTML:QueryFields( "Name" ) + NewLine + ; - "
  • Phone: " + oHTML:QueryFields( "Phone" ) + NewLine + ; - "
  • Address: " + oHTML:QueryFields( "Address" ) + NewLine + ; - "


Copyright © 1999 by Harbour Project" + ; - "
Generated at: " + dtoc( date() ) + " - " + time(), "LEFT" ) + hFile := fOpen( "list.txt", 0 ) + + cString := space( IF_BUFFER ) + cBuf := "" + cTable := "" + + // Builds dynamic table replacement + WHILE (nPos := fRead( hFile, @cString, IF_BUFFER )) > 0 + i := 1 + DO WHILE i <= nPos + + IF substr( cString, i, 1 ) = chr( 13 ) + i := i + 1 + cLine := cBuf + cBuf := "" + + IF left( cLine, 1 ) <> ';' + cTable += '' + chr(10)+chr(13) + ; + '' + ; + ParseString( cLine, ';', 1 ) + '' + chr(10)+chr(13) + ; + '' + ; + if( ParseString( cLine, ';', 2 ) = 'R', ; + '
', ; + ' ' ) + ; + '' + chr(10)+chr(13) + ; + '' + ; + if( ParseString( cLine, ';', 2 ) = 'S', ; + '
', ; + ' ' ) + ; + '' + chr(10)+chr(13) + ; + '' + ; + if( ParseString( cLine, ';', 2 ) = 'N', ; + '
', ; + ' ' ) + ; + '' + chr(10)+chr(13) + ; + '' + ENDIF + ELSE + cBuf := cBuf + substr( cString, i, 1 ) + ENDIF + + i++ + ENDDO + ENDDO + + fClose( hFile ) + + oHTML:AddReplaceTag( "Functions", cTable ) oHTML:Generate() // Uncomment the following if you don't have a Web Server to test // this sample - // oHTML:SaveToFile( "test.htm" ) +// oHTML:SaveToFile( "test.htm" ) // If the above is uncommented, you may comment this line: @@ -45,6 +92,30 @@ FUNCTION Main() RETURN( NIL ) +FUNCTION ParseString( cString, cDelim, nRet ) + + LOCAL cBuf, aElem, nPosFim, nSize, i + + nSize := len( cString ) - len( StrTran( cString, cDelim, '' ) ) + 1 + aElem := array( nSize ) + + cBuf := cString + i := 1 + FOR i := 1 TO nSize + nPosFim := at( cDelim, cBuf ) + + IF nPosFim > 0 + aElem[i] := substr( cBuf, 1, nPosFim - 1 ) + ELSE + aElem[i] := cBuf + ENDIF + + cBuf := substr( cBuf, nPosFim + 1, len( cBuf ) ) + + NEXT i + + RETURN( aElem[ nRet ] ) + FUNCTION Hex2Dec( cHex ) LOCAL aHex := { { "0", 00 }, ; @@ -91,6 +162,8 @@ FUNCTION THTML oClass:AddData( "aCGIContents" ) oClass:AddData( "aQueryFields" ) + oClass:AddData( "cHTMLFile" ) + oClass:AddData( "aReplaceTags" ) oClass:AddMethod( "New", @New() ) // New Method oClass:AddMethod( "SetTitle", @SetTitle() ) // Set Page Title @@ -100,10 +173,12 @@ FUNCTION THTML oClass:AddMethod( "SaveToFile", @SaveToFile() ) // Saves Content to File oClass:AddMethod( "ShowResult", @ShowResult() ) // Show Result - SEE Fcn oClass:AddMethod( "Generate", @Generate() ) // Generate HTML + oClass:AddMethod( "SetHTMLFile",@SetHTMLFile() ) // Sets source HTML file - oClass:AddMethod( "ProcessCGI", @ProcessCGI() ) - oClass:AddMethod( "GetCGIParam", @GetCGIParam() ) - oClass:AddMethod( "QueryFields", @QueryFields() ) + oClass:AddMethod( "ProcessCGI", @ProcessCGI() ) + oClass:AddMethod( "GetCGIParam", @GetCGIParam() ) + oClass:AddMethod( "QueryFields", @QueryFields() ) + oClass:AddMethod( "AddReplaceTag", @AddReplaceTag() ) oClass:Create() @@ -123,6 +198,8 @@ STATIC FUNCTION New() ::cBody := "" ::aCGIContents := {} ::aQueryFields := {} + ::aReplaceTags := {} + ::cHTMLFile := "" RETURN( Self ) @@ -170,14 +247,68 @@ STATIC FUNCTION AddPara( cPara, cAlign ) STATIC FUNCTION Generate() LOCAL Self := QSelf() + LOCAL cFile, i, hFile, nPos, cRes + LOCAL lFlag := .f. - ::cContent := ; - "" + NewLine + ; - "" + ::cTitle + "" + NewLine + ; - "" + + NewLine + ; - ::cBody + NewLine + ; - "" + // Is this a meta file or hand generated script? + IF empty( ::cHTMLFile ) + ::cContent := ; + "" + NewLine + ; + "" + ::cTitle + "" + NewLine + ; + "" + + NewLine + ; + ::cBody + NewLine + ; + "" + ELSE + ::cContent := "" + + // Does cHTMLFile exists? + IF !File( ::cHTMLFile ) + ::cContent := "

Server Error

No such file: " + ; + ::cHTMLFile + ELSE + // Read from file + hFile := fOpen( ::cHTMLFile, 0 ) + cFile := space( IF_BUFFER ) + DO WHILE (nPos := fRead( hFile, @cFile, IF_BUFFER )) > 0 + + cFile := left( cFile, nPos ) + cRes += cFile + cFile := space( IF_BUFFER ) + + ENDDO + + fClose( hFile ) + + // Replace matched tags + i := 1 + ::cContent := cRes + /* TODO: Replace this DO WHILE with FOR..NEXT */ + DO WHILE i <= len( ::aReplaceTags ) + ::cContent := strtran( ::cContent, ; + "<#" + ::aReplaceTags[i, 1] + ">", ::aReplaceTags[i, 2] ) + i++ + ENDDO + + /* TODO: Clear remaining (not matched) tags */ + /* + cRes := "" + FOR i := 1 TO len( ::cContent ) + IF substr( ::cContent, i, 1 ) == "<" .AND. ; + substr( ::cContent, i + 1, 1 ) == "#" + lFlag := .t. + ELSEIF substr( ::cContent, i, 1 ) == ">" .AND. lFlag + lFlag := .f. + ELSEIF !lFlag + cRes += substr( ::cContent, i, 1 ) + ENDIF + NEXT i + + ::cContent := cRes + */ + + ENDIF + ENDIF RETURN( Self ) @@ -299,3 +430,19 @@ STATIC FUNCTION QueryFields( cQueryName ) ENDIF RETURN( cRet ) + +STATIC FUNCTION SetHTMLFile( cFile ) + + LOCAL Self := QSelf() + + ::cHTMLFile := cFile + + RETURN( Self ) + +STATIC FUNCTION AddReplaceTag( cTag, cReplaceText ) + + LOCAL Self := QSelf() + + aAdd( ::aReplaceTags, { cTag, cReplaceText } ) + + RETURN( Self )