Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Creating HTML Pages
Message
 
To
26/09/2000 09:14:04
Julie Ball
Gardner Publications, Inc.
Cincinnati, Ohio, United States
General information
Forum:
Visual FoxPro
Category:
Internet applications
Miscellaneous
Thread ID:
00420851
Message ID:
00421046
Views:
34
>I am attempting to create HTML pages for records that is entered into a database. I have a program that selects the records that I would like to display on a HTML page. The problem that I am incountering is a "String is too long to fit" error. I know that the problem is because I have memo fields displayed, but how can I get aroung this. I have included a few lines of my program so you can get an idea of how I am coding it.
>
>*** CREATE PRODUCT INDEX BY CATEGORY
>_PEJECT = 'NONE'
>_PLENGTH=32676
>_PLINENO= 1
>l_break = SPACE(25)
>GO TOP
>
>SELECT newsinfo
>Save_code = ' '
>SCAN
> IF mag_id='PT' AND current='X'
> SELECT newsinfo
> IF Save_code != alltrim(news_type)
> filename = alltrim(news_type)+'.html'
> Save_code = alltrim(news_type)
> SET DEVICE TO FILE 'C:\Websites\' + filename
> _PLINENO = 1
>****newsinfo.story is the memo field****
> @_PLINENO,0 SAY ALLTRIM(newsinfo.story)
> ENDIF
>ENDSCAN
>
>_PEJECT = 'AFTER'
>SET DEVICE TO SCREEN


If number of lines in memo is great as maximum dimension of array (65 000),
then you use this small code or ThsFrxToHTML( export report to html) or
FRX2Word.

1. The number of lines in memo is great as 65 000.
This code created some records from memo lines.

LOCAL lcSearchString, lnMemoLines, lnX, lcString, lnOccurs, lcStringTest, lcCursorR,;
laTest[1], lcLine, lcCursorA, lnArray, laTestAll[1], lnI, lnJ, lnZ, lnLines,;
lcStringTestOld
STORE "" TO lcStringTest, lcStringTestOld
lcSearchString = '___FieldSizesgoFH.ThsFieldToAscii("'
lnMemoLines = MEMLINES(&sgcSupportCursor->html)
IF lnMemoLines > 0
lcCursorR = This.Ths2015()
This.ThsCloseTable("&lcCursorR")
CREATE CURSOR "&lcCursorR" ( testfld M(4), typeline C(3))
IF USED("&lcCursorR")
SELECT (lcCursorR)
ENDIF
IF lnMemoLines > 20000
* If number of lines in memo is great as maximum dimension of array (65 000)
lcCursorA = This.Ths2015()
CREATE CURSOR "&lcCursorA" ( thtml M(4), lhtml L)
IF USED("&lcCursorA")
SELECT (lcCursorA)
APPEND BLANK
REPLACE thtml WITH &sgcSupportCursor->html,;
lhtml WITH .F.
ENDIF
lnMemoLine = lnMemoLines
DO WHILE .T.
IF lnMemoLine >= 1000
FOR lnI = 1000 TO 5000 STEP 100
lcString = MLINE(thtml,lnI)
IF !EMPTY(lcString)
lnI = 5001
ENDIF
ENDFOR
lnOccurs = AT(lcString,thtml)
lcString = SUBSTR(thtml,1,lnOccurs-1)
REPLACE thtml WITH SUBSTR(thtml,lnOccurs)
ELSE
lcString = thtml
REPLACE thtml WITH ""
ENDIF
lnMemoLine = MEMLINES(thtml)
APPEND BLANK
REPLACE thtml WITH lcString,;
lhtml WITH .T.
IF EOF() OR BOF()
GO TOP
ELSE
GO TOP
ENDIF
IF EMPTY(thtml)
EXIT
ENDIF
ENDDO
Previous
Reply
Map
View

Click here to load this message in the networking platform