Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Problem using genhtml.prg

Status
Not open for further replies.

Sng1

Programmer
Aug 3, 2021
65
IN
In development environment, every thing works fine but when I make executable, 'error _runcodeerror.prg is not found ' comes. I found this code in _html.vcx used in htmltag's error method. Below is the code from error method of _htmltag
Code:
 Lparameters nError, cMethod, nLine
Local lcMethod
External Array __RunCodeError

If nError=1426 Or nError=1945
	Return
Endif
lcMethod=Lower(Alltrim(cMethod))
If lcMethod=="runcode"
	Return __RunCodeError(Error(),0,"RunCode","",Message())
Endif
If Not DoDefault(nError, cMethod, nLine)
	Return .F.
Endif
 
SP2 has a fix of the reportlisteners. You should install that. I'm not sure whther the 3rd Hotfix for VFP9 SP2 also had a reportlistener fix, but while you're at it you could upgrade that, too.

Edit: I actually didn't checkwhether that is in the bugfix list coming with the download, but it's worth doing anyway, if you're not yet on version 09.00.0000.7423.

But if I understand you right the code I find in the _reportlistener class Error() event is this:
Code:
LPARAMETERS m.nError, m.cMethod, m.nLine
LOCAL m.lcOnError,m.lcErrorMsg,m.lcCodeLineMsg
THIS.HadError = .T.
IF this.lIgnoreErrors OR _vfp.StartMode>0
	RETURN .F.
ENDIF
m.lcOnError=UPPER(ALLTRIM(ON("ERROR")))
IF NOT EMPTY(m.lcOnError)
	m.lcOnError=STRTRAN(STRTRAN(STRTRAN(lcOnError,"ERROR()","nError"), ;
			"PROGRAM()","cMethod"),"LINENO()","nLine")
	&lcOnError
	RETURN
ENDIF
m.lcErrorMsg = THIS.PrepareErrorMessage(m.nError,m.cMethod, m.nLine)
THIS.LastErrorMessage = m.lcErrorMsg

THIS.DoMessage(m.lcErrorMsg, MB_ICONSTOP )

#IF OUTPUTCLASS_DEBUGGING
    ERROR m.nError
#ENDIF

And the htmllistener just inherits the Error() event from there.

Chriss
 
Chris,
I don't know whether htmllistener uses genhtml.prg or not. It am using this genhtml.prg and _html.vcx to send customized emails. So I think even if there is a fix available for reportlistener, it won't correct the problem I am facing. Do you mean I should paste the code you have pasted above to the error method which is causing the problem?
 
Sorry, I see you were referring to the htmltag class of the _html.vcx.

I have the same code there. EXTERNAL ARRAY should cause build to not complain about not finding a PRG.

But the usage of __RunCodeError(Error(),0,"RunCode","",Message()) points out it's actually not an array, as VFP can't address array elements with a string as one of the n indexes an n-dimensional array may have. (You can have as many dimensions as you like, but they have to be numbers).

There is a _runcode class in _environ.vcx and it reminds me of code block, but I don't see what it should do.

Have you tested the EXE? Because all in all the EXTERNAL ARRAY command just tells the VFP compiler to NOT look for a PRG of the array name. If you still get this in the compile errors, it doesn't mean it won't work at runtime. The simplest thing you could do to suppress the compile error is add a FUNCTION __RunCodeError(t1,t2,t3,t4,t5) into your main.prg. Check if that is ever called.

Chriss
 
Maybe just leave it as is. Because one other way this could work is generating a __RunCodeError.prg at runtime. And then you should not reroute that to your own. Something didn't work with calming the compiler to not report this by EXTERNAL ARRAY, but for sure it isn't an array.

Chriss
 
I got solution to the problem. When I was working in development envionment, I was accessing vcx file from Home() + '\ffc' folder. There are many other vcx required for running genhtml.prg which I was getting in development envionment. When I was making exe, I copied _Html.vcx from that folder to the folder where my other vcx were placed required for the project. Now , there were few other vcx which were required for making executable but it was not getting . The moment I selected vcx from Home() + '\ffc' path, other required vcx were automatically included and now I am not getting error in exe.
 
Good.

Yes, "Home() + '\ffc'" often occurs in ffc code, so whenever you copy the whole ffc folder into your project references still go back into Home() instead. So better leave it there. But also better give yourself full permissions on the Home() folder so a project build with "recompile all files" won't create rubbish.

Chriss
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top