/** * * Harbour Test of a HTML-Generator class. * * Tips: - Use ShowResults to make dynamic html (to test dynamic * results, put the exe file on CGI-BIN dir or equivalent); * - Use SaveToFile to make static html page * */ #include "hbclass.ch" PROCEDURE Main() LOCAL oHTML := THtml():New() oHTML:SetTitle( "Harbour Power Demonstration" ) oHTML:AddHead( "Harbour" ) oHTML:AddPara( "Harbour is xBase at its best. Have a taste today!", "left" ) oHTML:AddPara( "L i n k s", "center" ) oHTML:AddLink( "https://harbour.github.io", "Meet the Harbour power!" ) oHTML:Generate() // Uncomment the following if you don't have a Web Server to test // this sample // oHTML:SaveToFile( "test.htm" ) // If the above is uncommented, you may comment this line: oHTML:ShowResult() RETURN CREATE CLASS THTML VAR cTitle // Page Title VAR cBody // HTML Body Handler VAR cBGColor // Background Color VAR cLinkColor // Link Color VAR cvLinkColor // Visited Link Color VAR cContent // Page Content Handler METHOD New() // New Method METHOD SetTitle( cTitle ) // Set Page Title METHOD AddLink( cLinkTo, cLinkName ) // Add
" + hb_eol() + ; cPara + hb_eol() + ; "
" RETURN Self METHOD Generate() CLASS THTML ::cContent := ; "" + hb_eol() + ; "