Char string size limit still 64k?
- Roger Seiler
- Posts: 223
- Joined: Thu Dec 01, 2005 3:34 pm
- Location: Nyack, New York, USA
- Contact:
Char string size limit still 64k?
I had previously understood that in 32 bits we don't have the 64k size limit for a char string that we had in 16 bits. However, I saw in the xHarbour documentation for Memoread() that there still is a 64k size limit for a char string in xHarbour.
How about FWH - do we still have a 64k limit for a char string?
- Roger
How about FWH - do we still have a 64k limit for a char string?
- Roger
- Rick Lipkin
- Posts: 2397
- Joined: Fri Oct 07, 2005 1:50 pm
- Location: Columbia, South Carolina USA
Roger,
Whether there is a limit or not, I don't know.
In FiveWin or Clipper 16 Bit, the limit was indeed 64K.
In Fivewin for Harbour/xHarbour the limit exceeds for sure 1 MB (I already used a variable containing more than 1 000 000 characters.
Whether there is a limit or not, I don't know.
In FiveWin or Clipper 16 Bit, the limit was indeed 64K.
In Fivewin for Harbour/xHarbour the limit exceeds for sure 1 MB (I already used a variable containing more than 1 000 000 characters.
Regards,
Michel D.
Genk (Belgium)
_____________________________________________________________________________________________
I use : FiveWin for (x)Harbour v. 21.01 - Harbour 3.2.0 (October 2020) - xHarbour Builder (January 2020) - Bcc7
Michel D.
Genk (Belgium)
_____________________________________________________________________________________________
I use : FiveWin for (x)Harbour v. 21.01 - Harbour 3.2.0 (October 2020) - xHarbour Builder (January 2020) - Bcc7
- nageswaragunupudi
- Posts: 8017
- Joined: Sun Nov 19, 2006 5:22 am
- Location: India
- Contact:
- Antonio Linares
- Site Admin
- Posts: 37481
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Contact:
Roger,
Here you have a working sample that shows that there is no limit (up to 4GB or available memory) for MemoRead():
Here you have a working sample that shows that there is no limit (up to 4GB or available memory) for MemoRead():
Code: Select all
function Main()
local cText := Replicate( "This is a test", 10000000 )
MsgInfo( Len( cText ) )
MemoWrit( "test.txt", cText )
cText = "" // we empty the variable
cText = MemoRead ( "test.txt" )
MsgInfo( Len( cText ) )
return nil
- Patrick Mast
- Posts: 244
- Joined: Sat Mar 03, 2007 8:42 pm
Re: Char string size limit still 64k?
Hello Roger,
Patrick
I just looke at our doc's at http://www.xharbour.com/xhdn/referenceg ... d&id=19161 but I can not see anything that says something about a limit. Where did you find the 4GB limit doc's?Roger Seiler wrote:I had previously understood that in 32 bits we don't have the 64k size limit for a char string that we had in 16 bits. However, I saw in the xHarbour documentation for Memoread() that there still is a 64k size limit for a char string in xHarbour.
Patrick
- Antonio Linares
- Site Admin
- Posts: 37481
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Contact:
- Roger Seiler
- Posts: 223
- Joined: Thu Dec 01, 2005 3:34 pm
- Location: Nyack, New York, USA
- Contact:
Thanks Antonio and others for your replies, which were reassuring.
Patrick, here is a quote from the \xhb\cod\xHarbour.chm functions section, the topic on Memoread()...
"• Return value:
MEMOREAD() returns the contents of a text file as a character string. The maximum file size that can be read is 65,535 characters (64K) -- the maximum size of a character string. If <cFile> cannot be found, MEMOREAD() returns a null string (""). "
So, I think that this text apparently needs to be corrected. But it's not at all surprising that in such a large help file, there may be just a few things that are a little off. On the whole, I know that the xHb documentation was a huge effort done very carefully.
- Roger
Patrick, here is a quote from the \xhb\cod\xHarbour.chm functions section, the topic on Memoread()...
"• Return value:
MEMOREAD() returns the contents of a text file as a character string. The maximum file size that can be read is 65,535 characters (64K) -- the maximum size of a character string. If <cFile> cannot be found, MEMOREAD() returns a null string (""). "
So, I think that this text apparently needs to be corrected. But it's not at all surprising that in such a large help file, there may be just a few things that are a little off. On the whole, I know that the xHb documentation was a huge effort done very carefully.
- Roger
- Roger Seiler
- Posts: 223
- Joined: Thu Dec 01, 2005 3:34 pm
- Location: Nyack, New York, USA
- Contact:
Mystery solved. I was inadvertently looking at an obsolete version of the xHb help file. I actually have the current version of it here, but because it had a different file name than the old, it didn't overwrite the old when I updated. The current version does indeed have the correct information, in that the explanation for Memoread() makes no mention of any text size limit.
Sorry to waste everybody's time on this! I just need to pay more attention to the file date (in the name) when I open it up.
- Roger
Sorry to waste everybody's time on this! I just need to pay more attention to the file date (in the name) when I open it up.
- Roger
- Patrick Mast
- Posts: 244
- Joined: Sat Mar 03, 2007 8:42 pm