Article View: borland.public.cppbuilder.internet.web
Article #1039Re: how to convert text to html
From: viv
Date: Thu, 15 Sep 2005 03:44
Date: Thu, 15 Sep 2005 03:44
69 lines
2484 bytes
2484 bytes
Hi Hans,
I want it should be work as FrontPage Editor.
i.e when we type any text in normal tab of front page the corresponding htlm
code is genrated in HTML tab.
Is there any InBuild Component to do this?
Thanks,
Viv.
"Hans Galema" <notused@notused.nl> wrote in message
news:43281c12$1@newsgroups.borland.com...
> viv wrote:
>
>> Hello james,
>> How are you?
>>
>> then it should be converted to html as follows:
>>
>> <html>
>> <head>
>> <title></title>
>> </head>
>> <body>
>> <p>Hello james,</p>
>> <p>How are you?</p>
>> </body>
>> </html>
>
> So you want every line to be in a paragraph tag.
> Put all text in a TStringList and then add the
> tag's for every line:
>
> void __fastcall TForm1::Button1Click(TObject *Sender)
> {
> AnsiString Text = "Hello james,\r\n"
> "How are you?\r\n";
>
>
> TStringList *StringList = new TStringList;
>
> StringList->Text = Text;
>
> int nr = -1;
>
> while ( ++nr < StringList->Count )
> StringList->Strings[nr] = "<p>" + StringList->Strings[nr] + "</p> ";
>
>
> // Now add the relevant htmlcode before and after
>
> StringList->Text =
> "<html>\r\n"
> "<head>\r\n"
> "<title></title>\r\n"
> "</head>\r\n"
> "<body>\r\n"
> + StringList->Text
> + "</body>\r\n"
> "</html>";
>
> ShowMessage ( StringList->Text );
>
> delete StringList;
> }
>
> Hans.
Technical Details
Message-ID:
<4328edb6$1@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news4.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newsfeed.hal-mli.net!feeder1.hal-mli.net!news-out.newsfeeds.com!propagator3-LAX.newsfeeds.com!news-in.spamkiller.net!news-in.superfeed.net!caladan.landsraad.net!newsgroups.borland.com!not-for-mailReferences:
<43280c18$1@newsgroups.borland.com> <43281c12$1@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Thread: feeec,7e03cd2599fed9 X-Google-Attributes: gidfeeec,public X-Google-Language: ENGLISH,ASCII-7-bit From: "viv" <getvivek_2000@yahoo.com> Newsgroups: borland.public.cppbuilder.internet.web References: <43280c18$1@newsgroups.borland.com> <43281c12$1@newsgroups.borland.com> Subject: Re: how to convert text to html Date: Thu, 15 Sep 2005 09:14:00 +0530 Lines: 71 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2900.2180 X-RFC2646: Format=Flowed; Response X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180 NNTP-Posting-Host: 59.182.8.191 Message-ID: <4328edb6$1@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1126755766 59.182.8.191 (14 Sep 2005 20:42:46 -0700) Path: arc1-ca.pugleaf.net!g2news1.google.com!news4.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newsfeed.hal-mli.net!feeder1.hal-mli.net!news-out.newsfeeds.com!propagator3-LAX.newsfeeds.com!news-in.spamkiller.net!news-in.superfeed.net!caladan.landsraad.net!newsgroups.borland.com!not-for-mail