32k String & Text Box Limitation 
Author Message
 32k String & Text Box Limitation

This 32k size limitation on VB stings and text boxes is becoming a problem. I
have to write large strings out to a file, then read them back to process.
This of course adds a lot of disk access and slows down my program.

It sure would be nice to have a string or text box that could hold more than
32k. Any ideas? Am I missing something? If VB can't do this, maybe someone
could recommend an inexpensive text box that goes beyond 32k.

Thanks. I appreciate the help.

Paul, in Seattle



Sat, 08 Nov 2003 02:49:54 GMT  
 32k String & Text Box Limitation
The String data type itself is not limited to 32K  I believe it's ~2 billion
characters for a variable length string and ~64K for a fixed length string.
A textbox's Text property, OTOH, is limited to ~64K.  This is for VB5 and
VB6.  For earlier versions of VB, these limits may be less. For example, I
know that for VB3, a textbox's Text property is limited to ~32K and the
String data type is ~64K.

A RichTextBox has no such limit to it's Text property.  I believe it's
limited only by available memory.

Mike


Quote:
> This 32k size limitation on VB stings and text boxes is becoming a
problem. I
> have to write large strings out to a file, then read them back to process.
> This of course adds a lot of disk access and slows down my program.

> It sure would be nice to have a string or text box that could hold more
than
> 32k. Any ideas? Am I missing something? If VB can't do this, maybe someone
> could recommend an inexpensive text box that goes beyond 32k.

> Thanks. I appreciate the help.

> Paul, in Seattle



Sat, 08 Nov 2003 03:40:21 GMT  
 32k String & Text Box Limitation


Quote:
> This 32k size limitation on VB stings and text boxes is becoming a
problem. I
> have to write large strings out to a file, then read them back to process.
> This of course adds a lot of disk access and slows down my program.

> It sure would be nice to have a string or text box that could hold more
than
> 32k. Any ideas? Am I missing something? If VB can't do this, maybe someone
> could recommend an inexpensive text box that goes beyond 32k.

If I'm not mistaken, I believe the Rich Text Box does not have
such a low limit.

Terry Austin



Sat, 08 Nov 2003 03:35:48 GMT  
 32k String & Text Box Limitation
As others have mentioned, use the RichTextBox control. I just wanted to add a
note about loading and saving since you mentioned that in your post. The
RichTextBox has a LoadFile and SaveFile method that takes care of the whole
process automatically (no FSO or Open/Close). Just note that the default
load/save method is to use RichText Format. To use plain text, specify rtfText
for the 2nd, optional argument. Also, check out the Find method as it lets you
locate text and automatically highlight it (this can be turned off) very
quickly. There are other useful properties and methods and you should check them
out, but the above should prove useful immediately.

Rick


Quote:
> This 32k size limitation on VB stings and text boxes is becoming a problem. I
> have to write large strings out to a file, then read them back to process.
> This of course adds a lot of disk access and slows down my program.

> It sure would be nice to have a string or text box that could hold more than
> 32k. Any ideas? Am I missing something? If VB can't do this, maybe someone
> could recommend an inexpensive text box that goes beyond 32k.

> Thanks. I appreciate the help.

> Paul, in Seattle



Sat, 08 Nov 2003 08:22:53 GMT  
 32k String & Text Box Limitation


Wed, 18 Jun 1902 08:00:00 GMT  
 32k String & Text Box Limitation

Quote:
> This 32k size limitation on VB stings and text boxes is becoming a problem.

I don't know which version of VB you're referring to, but the true facts are:

A variable-length string can contain up to approximately 2 billion (2^31) chars.
A fixed-length string can contain 1 to approximately 64K (2^16) chars.
SOURCE: VB5 Pro's Help Files.

The Text setting for a TextBox control is limited to 2048 characters unless the
MultiLine property is True, in which case the limit is about 32K.
SOURCE: VB5 Pro's Help Files.

The default for the [RichTextBox] MaxLength property is 0, indicating no maximum
other than that created by memory constraints on the user's system.
SOURCE:
http://msdn.microsoft.com/library/devprods/vs6/vbasic/rtfbox98/vbprom...

Regards, Otser.



Sat, 08 Nov 2003 09:23:30 GMT  
 32k String & Text Box Limitation

Quote:


> > This 32k size limitation on VB stings and text boxes is becoming a problem.

> I don't know which version of VB you're referring to, but the true facts are:

> A variable-length string can contain up to approximately 2 billion (2^31) chars.
> A fixed-length string can contain 1 to approximately 64K (2^16) chars.
> SOURCE: VB5 Pro's Help Files.

> The Text setting for a TextBox control is limited to 2048 characters unless the
> MultiLine property is True, in which case the limit is about 32K.
> SOURCE: VB5 Pro's Help Files.

> The default for the [RichTextBox] MaxLength property is 0, indicating no maximum
> other than that created by memory constraints on the user's system.
> SOURCE:
> http://msdn.microsoft.com/library/devprods/vs6/vbasic/rtfbox98/vbprom...

> Regards, Otser.

Hi Paul-

And just to further throw a wrench into the works --- don't forget the
UNICODE problem.
Remember, that 32K cuts down to about 16K or less because each character
takes 2 bytes in UNICODE. While this may not be a problem in most apps,
it can become a real issue depending on the datasource from which your
textbox is filled.

Later,

Randy Barrow
--

==============================================
Please remove NOSPAM from address for replies
==============================================



Sat, 08 Nov 2003 11:54:29 GMT  
 32k String & Text Box Limitation
Actually, UNICODE is not a problem here.

Because under the covers, VB never uses Unicode for the control itself. So
the limit it still 32K.

--
MichKa

the only book on internationalization in VB at
http://www.i18nWithVB.com/


Quote:


> > > This 32k size limitation on VB stings and text boxes is becoming a
problem.

> > I don't know which version of VB you're referring to, but the true facts
are:

> > A variable-length string can contain up to approximately 2 billion
(2^31) chars.
> > A fixed-length string can contain 1 to approximately 64K (2^16) chars.
> > SOURCE: VB5 Pro's Help Files.

> > The Text setting for a TextBox control is limited to 2048 characters
unless the
> > MultiLine property is True, in which case the limit is about 32K.
> > SOURCE: VB5 Pro's Help Files.

> > The default for the [RichTextBox] MaxLength property is 0, indicating no
maximum
> > other than that created by memory constraints on the user's system.
> > SOURCE:

http://msdn.microsoft.com/library/devprods/vs6/vbasic/rtfbox98/vbprom...
ho.htm

- Show quoted text -

Quote:

> > Regards, Otser.

> Hi Paul-

> And just to further throw a wrench into the works --- don't forget the
> UNICODE problem.
> Remember, that 32K cuts down to about 16K or less because each character
> takes 2 bytes in UNICODE. While this may not be a problem in most apps,
> it can become a real issue depending on the datasource from which your
> textbox is filled.

> Later,

> Randy Barrow
> --

> ==============================================
> Please remove NOSPAM from address for replies
> ==============================================



Sat, 08 Nov 2003 12:07:18 GMT  
 32k String & Text Box Limitation


Wed, 18 Jun 1902 08:00:00 GMT  
 32k String & Text Box Limitation
I am slightly baffled why anyone would want 32k of data in a Textbox -
a Textbox is a Visual control - and short of using it to produce a
crude word processor - there seems little chance of a user being able
to 'comprehend' 32k of data.

If you want to display a log file then store it on disk and just
display the lines you want in, say, a Listbox (just the visible lines)

If you are processing data then as others have pointed out, Strings
and Byte Arrays have a 2mb limit.


Quote:

>This 32k size limitation on VB stings and text boxes is becoming a problem. I
>have to write large strings out to a file, then read them back to process.
>This of course adds a lot of disk access and slows down my program.

>It sure would be nice to have a string or text box that could hold more than
>32k. Any ideas? Am I missing something? If VB can't do this, maybe someone
>could recommend an inexpensive text box that goes beyond 32k.

>Thanks. I appreciate the help.

>Paul, in Seattle



Sat, 08 Nov 2003 16:48:17 GMT  
 32k String & Text Box Limitation


Quote:
>I am slightly baffled why anyone would want 32k of data in a Textbox -
>a Textbox is a Visual control - and short of using it to produce a
>crude word processor - there seems little chance of a user being able
>to 'comprehend' 32k of data.

>If you want to display a log file then store it on disk and just
>display the lines you want in, say, a Listbox (just the visible lines)

>If you are processing data then as others have pointed out, Strings
>and Byte Arrays have a 2mb limit.

An excellent freeware program editor , PFE, was written using a
standard Windows text box control as the edit window. By only showing
a small part of the total file in the text box at a time, PFE can edit
multi-megabyte sized files.

Richard.



Sat, 08 Nov 2003 18:05:01 GMT  
 32k String & Text Box Limitation

Quote:
>I am slightly baffled why anyone would want 32k of data in a Textbox -
>a Textbox is a Visual control - and short of using it to produce a
>crude word processor - there seems little chance of a user being able
>to 'comprehend' 32k of data.

Thanks for all the pointers. I think I'll go with the RichText Box.

I'm using the Catalyst Http control to grab web pages -- at least the text
portion. Then my program goes throught the html code and extracts the
essential infomation. In this case stock quotes. What I like about using the
RichText box, is that as I'm writing the code, I can watch all my string
manupulation statements execute. I know I can also set up a Watch to do that,
and sometimes I do, for the shorter length fields.

I don't know for sure, but I guess there is some additional overhead doing
string manuplations on a RichText box as opposed to a string. I doubt it's
much and it makes writing the code so much easier.

Paul.



Sat, 08 Nov 2003 22:39:59 GMT  
 32k String & Text Box Limitation


Wed, 18 Jun 1902 08:00:00 GMT  
 32k String & Text Box Limitation
I have noticed this limit when using Win98, but running the exact same
program in Win2K, there is a much higher limit on how much can fit in a
textbox.  Hasn't anyone else observed this?


Quote:
> This 32k size limitation on VB stings and text boxes is becoming a
problem. I
> have to write large strings out to a file, then read them back to process.
> This of course adds a lot of disk access and slows down my program.

> It sure would be nice to have a string or text box that could hold more
than
> 32k. Any ideas? Am I missing something? If VB can't do this, maybe someone
> could recommend an inexpensive text box that goes beyond 32k.

> Thanks. I appreciate the help.

> Paul, in Seattle



Sun, 09 Nov 2003 09:33:33 GMT  
 32k String & Text Box Limitation
On Wed, 23 May 2001 01:33:33 GMT, "Ryan Morris \(M\)"

Win2k is essentially NT when it comes to variable limits.

Quote:
>I have noticed this limit when using Win98, but running the exact same
>program in Win2K, there is a much higher limit on how much can fit in a
>textbox.  Hasn't anyone else observed this?



>> This 32k size limitation on VB stings and text boxes is becoming a
>problem. I
>> have to write large strings out to a file, then read them back to process.
>> This of course adds a lot of disk access and slows down my program.

>> It sure would be nice to have a string or text box that could hold more
>than
>> 32k. Any ideas? Am I missing something? If VB can't do this, maybe someone
>> could recommend an inexpensive text box that goes beyond 32k.

>> Thanks. I appreciate the help.

>> Paul, in Seattle

Regards, Frank.


Sun, 09 Nov 2003 09:55:37 GMT  
 
 [ 18 post ]  Go to page: [1] [2]

 Relevant Pages 

1. rich text box SelStart with text > 32K

2. Limitation of List Box & Combo boxes

3. Text box > 32K

4. HELP!! Text Box >32k

5. HELP: Creating Text Box over 32K in VB 3.0

6. Text box > 32K

7. Help, 32K limit on Text box!!!!

8. TROUBLE WITH SIZE OF TEXT BOX'S IN VB (only 32k) - temp.txt [1/1]

9. Text Box >32K

10. text box & query string

11. text + pasted text > 32k

12. Text box limitations?

 

 
Powered by phpBB® Forum Software