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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Having trouble generating a .htm file

Status
Not open for further replies.

rnathan

Programmer
Jun 27, 2002
41
0
0
US
Hi all,

I have created a small app that would create htm files of several tables. When I run the .prg file, it creates all the htm files without any problems. But when I run the executable, I get 'File does not exist' error right above the statment 'DO (_genhtml) with lcOutFile, lcSourceFile'. I have added genhtml.prg in the code segment of Project Manager. I am not sure if I have to add any other dlls.

** Sample code

lcSourceFile = "D:\CommStat\CommStatus.dbf"
lcOutFile = "D:\Commstat\StateNY.HTM"
** This is where the error occurs
DO (_genhtml) with lcOutFile, lcSourceFile

***

I am using VFP 6.0 and NT 4.0. Thanks in advance.

Rita

 
I took a look at the code at FAQ. Is there a way we can create an htm file with one line of code like 'DO (_genhtml) with lcOutFile, lcSourceFile' without getting an error msg? Thanks.

Rita
 
Rita,

_genhtml is a system variable that only exist under VFP development (IDE). It doesn't exist at runtime. If you included the prg into the project, then you can just call the program name directly.

DO genhtml with lcOutFile, lcSourceFile

Not sure about this one, but I believe you must also included genhtml.dbf and fpt

Regards

-- AirCon --
 
Sorry, a correction.
_genhtml does exist at runtime but contain an empty string.

Regards

-- AirCon --
 
Yes, I've included genhtml.dbf and genhtml.fpt in the project and I tried both "Do genhtml with" and "DO _genhtml With". Either way, I'm still getting the 'File does not exist' error.

I tried Brian's suggestion as per FAQ. I get "Function argument value, type, or count is invalid" error at STRTOFILE(lcHTML, "D:\Test\Test.htm"). Is there a limit on the size of the table that is being converted to htm? My table size is 800K. Or is it because I am using VFP 6.0?

Rita
 
Here is what I would do ...

Include the Visual Foxpro GENHTML.PRG in your project.

Then run this code ...

lcSourceFile = "D:\CommStat\CommStatus.dbf"
lcOutFile = "D:\Commstat\StateNY.HTM"
** This is where the error occurs
DO genhtml with lcOutFile, lcSourceFile



Don


 
I've included genhtml.prg. The error occurs only when I run the executable.

Rita
 
Well, I don't what else to tell you.

I have this exact code working just fine.

I am running this in VFP8 but the process should be the same. Put genhtml.prg into your project and build your project and LOCATE the files it asks you for.


My project needed to have genhtml.prg and runcode.prg and setobjrf in it.



* demo_html.prg
*
*
IF FILE("html.htm")
ERASE html.htm
ENDIF
INKEY(1)
DO genhtml WITH "html.htm", "csr_customers.dbf"
INKEY(1)
MODIFY FILE html.htm
RETURN


Don


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top