see changelog
This commit is contained in:
@@ -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,
|
||||
|
||||
50
harbour/tests/working/function.cfm
Normal file
50
harbour/tests/working/function.cfm
Normal file
@@ -0,0 +1,50 @@
|
||||
<html>
|
||||
|
||||
<head>
|
||||
<meta http-equiv="Content-Type"
|
||||
content="text/html; charset=iso-8859-1">
|
||||
<title>Harbour function task list</title>
|
||||
</head>
|
||||
|
||||
<body bgcolor="#FFFFFF">
|
||||
|
||||
<p align="center"><img src="/harbour-project/images/clouds.jpg" alt="clouds.jpg (2615 bytes)" WIDTH="550" HEIGHT="36"></p>
|
||||
|
||||
<font SIZE="2">
|
||||
|
||||
<p align="center"></font><font face="Tahoma" size="4"><strong>Function Task List</strong></font><font SIZE="2">
|
||||
<br><small><a href="funcs.dll?Lang=BR">In Portuguese</A></p>
|
||||
|
||||
<p><font size="2" face="Tahoma">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:</font></p>
|
||||
|
||||
<p><font size="2" face="Tahoma"><strong>Ready</strong><br>
|
||||
No more work needed on this function.</font></p>
|
||||
|
||||
<p><font size="2" face="Tahoma"><strong>Started</strong><br>
|
||||
This function needs some work but will provide basic
|
||||
functionality and can be used for testing.</font></p>
|
||||
|
||||
<p><font size="2" face="Tahoma"><strong>Not Started</strong><br>
|
||||
This function has yet to be written.</font></p>
|
||||
|
||||
<table border="1" cellpadding="2" cellspacing="1" width="500" align="Center">
|
||||
<tr>
|
||||
<td width="50%" bgcolor="#3000FF" rowspan=2><font size="2" face="Tahoma" color="#ffff00"><center><b>Function</B></font></td>
|
||||
<td width="50%" bgcolor="#3000FF" colspan=3><font size="2" face="Tahoma" color="#ffff00"><center><b>Status</B></font></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width="16%" bgcolor="#3000FF"><font size="2" face="Tahoma" color="#ffff00"><center><b>Ready</B></font></td>
|
||||
<td width="16%" bgcolor="#3000FF"><font size="2" face="Tahoma" color="#ffff00"><center><b>Started</B></font></td>
|
||||
<td width="16%" bgcolor="#3000FF"><font size="2" face="Tahoma" color="#ffff00"><center><b>Not Started</B></font></td>
|
||||
</tr>
|
||||
<#Functions>
|
||||
</table>
|
||||
|
||||
<P>
|
||||
<center><font size="1" face="Tahoma">Last Update: April 28, 1999
|
||||
|
||||
</body>
|
||||
</html>
|
||||
238
harbour/tests/working/list.txt
Normal file
238
harbour/tests/working/list.txt
Normal file
@@ -0,0 +1,238 @@
|
||||
;
|
||||
; The Harbour Project
|
||||
; List.txt - Function Status List
|
||||
;
|
||||
; Syntax:
|
||||
; <function>;<state>
|
||||
;
|
||||
; Where:
|
||||
; <state> - [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<g> (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
|
||||
@@ -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( "<UL>" + NewLine + ;
|
||||
"<LI>Name: " + oHTML:QueryFields( "Name" ) + NewLine + ;
|
||||
"<LI>Phone: " + oHTML:QueryFields( "Phone" ) + NewLine + ;
|
||||
"<LI>Address: " + oHTML:QueryFields( "Address" ) + NewLine + ;
|
||||
"</UL><P><HR><SMALL><CENTER>Copyright © 1999 by Harbour Project" + ;
|
||||
"<BR>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 += '<TR>' + chr(10)+chr(13) + ;
|
||||
'<TD WIDTH="50%"><FONT SIZE="2" FACE="Tahoma">' + ;
|
||||
ParseString( cLine, ';', 1 ) + '</FONT></TD>' + chr(10)+chr(13) + ;
|
||||
'<TD WIDTH="16%">' + ;
|
||||
if( ParseString( cLine, ';', 2 ) = 'R', ;
|
||||
'<CENTER><IMG SRC="images/purple-m.gif">', ;
|
||||
' ' ) + ;
|
||||
'</TD>' + chr(10)+chr(13) + ;
|
||||
'<TD WIDTH="16%">' + ;
|
||||
if( ParseString( cLine, ';', 2 ) = 'S', ;
|
||||
'<CENTER><IMG SRC="images/purple-m.gif">', ;
|
||||
' ' ) + ;
|
||||
'</TD>' + chr(10)+chr(13) + ;
|
||||
'<TD WIDTH="16%">' + ;
|
||||
if( ParseString( cLine, ';', 2 ) = 'N', ;
|
||||
'<CENTER><IMG SRC="images/purple-m.gif">', ;
|
||||
' ' ) + ;
|
||||
'</TD>' + chr(10)+chr(13) + ;
|
||||
'</TR>'
|
||||
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 := ;
|
||||
"<HTML><HEAD>" + NewLine + ;
|
||||
"<TITLE>" + ::cTitle + "</TITLE>" + NewLine + ;
|
||||
"<BODY link='" + ::cLinkColor + "' " + ;
|
||||
"vlink='" + ::cvLinkColor + "'>" + + NewLine + ;
|
||||
::cBody + NewLine + ;
|
||||
"</BODY></HTML>"
|
||||
// Is this a meta file or hand generated script?
|
||||
IF empty( ::cHTMLFile )
|
||||
::cContent := ;
|
||||
"<HTML><HEAD>" + NewLine + ;
|
||||
"<TITLE>" + ::cTitle + "</TITLE>" + NewLine + ;
|
||||
"<BODY link='" + ::cLinkColor + "' " + ;
|
||||
"vlink='" + ::cvLinkColor + "'>" + + NewLine + ;
|
||||
::cBody + NewLine + ;
|
||||
"</BODY></HTML>"
|
||||
ELSE
|
||||
::cContent := ""
|
||||
|
||||
// Does cHTMLFile exists?
|
||||
IF !File( ::cHTMLFile )
|
||||
::cContent := "<H1>Server Error</H1><P><I>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 )
|
||||
|
||||
Reference in New Issue
Block a user