HTML processing

The AutoScript can be embedded into HTML files. We process those HTML files by calling the html_processfile procedure.

 

Here is an initial HTML file (HISTORY.HTM), with AutoScript in it. After the processing a new file is produced (the final HTML file) _HISTORY.HTM.

 

Note here that the standard procedure message, when is used into HTML files, simply outputs to the final HTML file.

 

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">

<html>

<head>

<meta http-equiv=Content-Language content=el>

<meta http-equiv=Content-Type content="text/html, charset=iso-8859-7">

<?kcode

 

     {............................................................ actities for today}

 

     title0 = strcat("Activities at : ",crDate)

     title1 = "Day"

     title2 = "Hour"

     title3 = "User"

     title4 = "Activity"

     title5 = "Table"

     title6 = "Recodr Id"

 

     call message("</HEAD>")

     call message("<BODY>")

     call message("<H2>",title0,"</H2>")

     call message("<TABLE width=1200 BORDER=1 CELLSPACING=0 CELLPADDING=0>")

     call message("<TR>")

     call message("<TD WIDTH=200 bgcolor='C0F0FF'><P><font face=Verdana size=4>",title1,"</FONT></P></TD>")

     call message("<TD WIDTH=200 bgcolor='C0F0FF'><P><font face=Verdana size=4>",title2,"</FONT></P></TD>")

     call message("<TD WIDTH=200 bgcolor='C0F0FF'><P><font face=Verdana size=4>",title3,"</FONT></P></TD>")

     call message("<TD WIDTH=200 bgcolor='C0F0FF'><P><font face=Verdana size=4>",title4,"</FONT></P></TD>")

     call message("<TD WIDTH=200 bgcolor='C0F0FF'><P><font face=Verdana size=4>",title5,"</FONT></P></TD>")

     call message("<TD WIDTH=200 bgcolor='C0F0FF'><P><font face=Verdana size=4>",title6,"</FONT></P></TD>")

     call message("</TR>")

 

     start_sql "DATA11" "KOSMOS"

        SELECT

           AU_HISTORY.DAT, AU_HISTORY.TIM, AU_HISTORY.USR,

           AU_HISTORY.OPERATION, AU_HISTORY.TBL, AU_HISTORY.RECORDID

        FROM

           AU_HISTORY

        ORDER BY

           AU_HISTORY.DAT, AU_HISTORY.TIM,

     end_sql

 

     call RunEmbSQL("DATA11")

     q = QueryByName("DATA11")

 

     rcount = TRecordCount(q)

     call TFirst(q)

 

     for i = 1 to rcount

 

          param1 = TGetFld(q,"DAT")

          param2 = TGetFld(q,"TIM")

          param3 = TGetFld(q,"USR")

          param4 = TGetFld(q,"OPERATION")

          param5 = TGetFld(q,"TBL")

          param6 = TGetFld(q,"RECORDID")

 

          call message("<TR>")

          call message("<TD WIDTH=200 bgcolor='C0F0FF'><P><font face=Verdana size=4>",param1,"</FONT></P></TD>")

          call message("<TD WIDTH=200 bgcolor='C0F0FF'><P><font face=Verdana size=4>",param2,"</FONT></P></TD>")

          call message("<TD WIDTH=200 bgcolor='C0F0FF'><P><font face=Verdana size=4>",param3,"</FONT></P></TD>")

          call message("<TD WIDTH=200 bgcolor='C0F0FF'><P><font face=Verdana size=4>",param4,"</FONT></P></TD>")

          call message("<TD WIDTH=200 bgcolor='C0F0FF'><P><font face=Verdana size=4>",param5,"</FONT></P></TD>")

          call message("<TD WIDTH=200 bgcolor='C0F0FF'><P><font face=Verdana size=4>",param6,"</FONT></P></TD>")

          call message("</TR>")

 

          call TNext(q)

 

     next

 

     call FreeEmbSQL("DATA11")

 

?>

 

</TABLE>

</BODY>

</HTML>