Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Automatically convert HTML string to StringBuilder code
Message
General information
Forum:
ASP.NET
Category:
Other
Miscellaneous
Thread ID:
00728692
Message ID:
00731775
Views:
29
>Here are some links that might help:
>
>http://www.aspalliance.com/stevesmith/articles/dotnetemailwebsite.asp
>
>http://www.aspalliance.com/stevesmith/articles/netscrape.asp
>

Thanks. They didn't have quite what I was looking for - I wrote some code up in VFP that does (basically) what I wanted. I tried writing it as a VS.NET macro but ran into the other problem w/using the clipboard; since this was meant to be a quickie tool, I didn't want to waste too much time on it.

BTW - if anyone is interested in it:
* Sample call
ParseHTML("control", .T.)

FUNCTION ParseHTML(tcControlName, tlAddReturn)
LOCAL lcText, ;
      laList[1], ;
      lcNewText, ;
      lnRows, ;
      lnIndex, ;
      lcControlName

lcText = _cliptext
lcNewText = ""

IF VARTYPE(tcControlName) <> "C"
   tcControlName = "control"
ENDIF

lcControlName = tcControlName

ALINES(laList, lcText, .T.)
lnRows = ALEN(laList, 1)

FOR lnIndex = 1 TO lnRows
    lcNewText = lcNewText + ParseLine(laList[lnIndex], lcControlName, tlAddReturn)
ENDFOR

lcNewText = [System.Text.StringBuilder ] + lcControlName + [ = new System.Text.StringBuilder();] + CHR(13) + CHR(13) + lcNewText

_cliptext = lcNewText

ENDFUNC

FUNCTION ParseLine(tcText, tcControl, tlAddReturn)
LOCAL lcText

lcText = tcText

lcText = STRTRAN(lcText, ["], [\"])
lcText = STRTRAN(lcText, CHR(9), [])

IF tlAddReturn
   lcText = lcText + [\n]
ENDIF
   
lcText = tcControl + [.Append("] + lcText + [");] + CHR(13)

RETURN lcText
ENDFUNC 
-Paul

RCS Solutions, Inc.
Blog
Twitter
Previous
Reply
Map
View

Click here to load this message in the networking platform