pmscraiova
Programmer
I want, if it is possible, to print my code, in different colour (such it appear in vfp editor). For example keywords = blue, variables = black)
Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
*ShowColor.PRG
LPARAMETERS p_cPRGFileName, p_cOutputFile
LOCAL lcText, lcHTML, ;
loHTML AS htmlcode OF mhhtmlcode.prg && VFP 7.0
IF PCOUNT() < 2 OR VARTYPE(p_cOutputFile) <> "C"
p_cOutputFile = 'sample.htm'
ENDIF
lcText = FILETOSTR(p_cPRGFileName)
loHTML = NEWOBJECT('htmlcode', 'mhhtmlcode.prg')
lcHTML = loHtml.PrgToHtml(lcText)
*?loHTML.nLines, ' lines in ', loHTML.nSeconds, ' seconds'
RELEASE loHTML
* Display the page in IE
llSafety = SET("Safety") = 'ON'
SET SAFETY OFF
STRTOFILE(lcHTML, p_cOutputFile)
IF llSafety
SET SAFETY ON
ENDIF
oIE = CREATEOBJECT("internetexplorer.application")
oIE.Navigate(FULLPATH(p_cOutputFile))
oIE.Visible = .t.