🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.cppbuilder.nativeapi
Article #6333

Re: AnsiString and the LineFeed char

#6333
From: Robert G. Hoover
Date: Tue, 17 May 2005 15:06
50 lines
2535 bytes
Thanks for the shortcut. There seems to be so many different ways to 
accomplish (nearly) the same thing that many solutions are often 
overlooked inadvertently.

So, I guess my question boils down to the GUI object that I'm using for 
display to the user and the interpretation of '\n' of that object. If 
I'm using a TMemo, then the '\n' is not interpreted as a EOL char, but 
rather it is displayed as \n. Ideally, I'd like to have that char 
interpreted as an EOL, or find an alternative.

For example, I'd like to send an AnsiString like the following....

AnsiString TextString = "1. Go to start.\n2. Walk north, 3 steps.\n3. 
Walk east, 5 steps.\n4. Dig up treasure.";

And I'd like that text to appear in my GUI as :

1. Go to start.
2. Walk north, 3 steps.
3. Walk east, 5 steps.
4. Dig up treasure.

Does this make sense? Is this possible, or do I have to create my own 
parser?

Thanks so much!

Rob


Remy Lebeau (TeamB) wrote:
> "Robert G. Hoover" <not.a.real.address@anywhere.sorry> wrote in message
> news:42826ce0@newsgroups.borland.com...
> 
> 
>>Is is possible to feed an AnsiString into a TMemo->Lines
>>and hardcode linefeeds?
> 
> 
> Yes, for example:
> 
>     void __fastcall THintForm::DisplayHint(TObject *Sender)
>     {
>         HintMemo->Lines->Text = GetLongHint(Application->Hint);
>     }
> 
> 
> Gambit
> 
> 
Technical Details
Message-ID: <428a086f$1@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!news.glorb.com!npeer.de.kpn-eurorings.net!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail
References: <42826ce0@newsgroups.borland.com> <428279f7$1@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Thread: 10cc67,617c7c48d8598286
X-Google-Attributes: gid10cc67,public
X-Google-Language: ENGLISH,ASCII-7-bit
Date: Tue, 17 May 2005 11:06:21 -0400
From: "Robert G. Hoover" <not.a.real.address@anywhere.sorry>
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.7) Gecko/20050414
X-Accept-Language: en-us, en
MIME-Version: 1.0
Newsgroups: borland.public.cppbuilder.nativeapi
Subject: Re: AnsiString and the LineFeed char
References: <42826ce0@newsgroups.borland.com> <428279f7$1@newsgroups.borland.com>
In-Reply-To: <428279f7$1@newsgroups.borland.com>
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit
X-Antivirus: avast! (VPS 0520-1, 05/17/2005), Outbound message
X-Antivirus-Status: Not-Tested
NNTP-Posting-Host: 68.48.159.204
Message-ID: <428a086f$1@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1116342383 68.48.159.204 (17 May 2005 08:06:23 -0700)
Lines: 50
Path: arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!news.glorb.com!npeer.de.kpn-eurorings.net!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail