🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.cppbuilder.internet.socket
Article #4907

Re: TIdHTTP end of content problem

#4907
From: hans galema
Date: Mon, 06 Dec 2004 11:16
29 lines
1788 bytes
Remy Lebeau (TeamB) wrote:

>>The 'end of the string' as when used with for instance
>>ShowMessage is at the first encountered zero.
> 
> Wrong.  ShowMessage() does not truncate strings on the first '\0' character
> at all.  It uses the full length of the AnsiString regardless of which
> characters are contained in it.

Wrong. It will use the complete string for determining the
width of the window but it will not show the content after the \0.

Try:

void __fastcall TForm1::Button1Click(TObject *Sender)
{
   AnsiString AS = "this is a truncated string";

   AS [10] = 0;

   ShowMessage ( AS );  // shows "this is a".

  // to get it even funnier try:

   ShowMessage ( AS + " something will be wider" );

}

Hans.
Technical Details
Message-ID: <41b43fa6$1@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!news.glorb.com!logbridge.uoregon.edu!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail
References: <41b15c54$1@newsgroups.borland.com> <41b25214@newsgroups.borland.com> <41b2d916$1@newsgroups.borland.com> <41b41051$3@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Thread: 11508e,6b94060483c79e05
X-Google-Attributes: gid11508e,public
X-Google-Language: ENGLISH,ASCII-7-bit
Date: Mon, 06 Dec 2004 12:16:37 +0100
From: hans galema <notused@notused.nl>
User-Agent: Mozilla Thunderbird 0.8 (Windows/20040913)
X-Accept-Language: en-us, en
MIME-Version: 1.0
Newsgroups: borland.public.cppbuilder.internet.socket
Subject: Re: TIdHTTP end of content problem
References: <41b15c54$1@newsgroups.borland.com> <41b25214@newsgroups.borland.com> <41b2d916$1@newsgroups.borland.com> <41b41051$3@newsgroups.borland.com>
In-Reply-To: <41b41051$3@newsgroups.borland.com>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
NNTP-Posting-Host: 129.125.201.248
Message-ID: <41b43fa6$1@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1102331814 129.125.201.248 (6 Dec 2004 03:16:54 -0800)
Lines: 29
Path: arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!news.glorb.com!logbridge.uoregon.edu!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail