473,763 Members | 2,714 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Strange string limit problem

xyz

I have a form that has a text box that allows multi-line text. When I
read an 80K file into it, only 64K characters are stored and
displayed. However, if I copy from the 80K file using the Windows
clipboard commands and then paste into the text box, all the
characters are stored and displayed.

This is how I read the file into the text box. It works fine until
the file exceeds 64K.

F = FreeFile
Open "tagtmp2.tm p" For Input As F
frmForm1!txtEdi t.Text = Input(LOF(F), F)
Close F

I have tried reading the file with LINE INPUT # into a string or
variant variable and then tried to assign the string to the text box
variable. E.g, txtEdit.Text = MyData and it also gets truncated.
This also happens concatenating character-by-character.

Since pasting into the text box works fine, I am assuming that I
should be able to store 2^32 characters into the txtEdit.Text string
as defined for VB for a varying string. The fact that only 2^16
characters are stored means that the text box is being interpreted as
a fixed string which has this smaller limit.

Does anybody know how to do this?

Thanks,
xyz

Jul 17 '05 #1
2 8911
While strings can be 2^32 characters, edit controls (text boxes) are limited
to 64k.

http://msdn.microsoft.com/library/de...imitations.asp

--

Randy Birch
MVP Visual Basic
http://www.mvps.org/vbnet/
Please respond only to the newsgroups so all can benefit.
"xyz" <xy*@mailinator .com> wrote in message
news:04******** *************** *********@4ax.c om...
:
: I have a form that has a text box that allows multi-line text. When I
: read an 80K file into it, only 64K characters are stored and
: displayed. However, if I copy from the 80K file using the Windows
: clipboard commands and then paste into the text box, all the
: characters are stored and displayed.
:
: This is how I read the file into the text box. It works fine until
: the file exceeds 64K.
:
: F = FreeFile
: Open "tagtmp2.tm p" For Input As F
: frmForm1!txtEdi t.Text = Input(LOF(F), F)
: Close F
:
: I have tried reading the file with LINE INPUT # into a string or
: variant variable and then tried to assign the string to the text box
: variable. E.g, txtEdit.Text = MyData and it also gets truncated.
: This also happens concatenating character-by-character.
:
: Since pasting into the text box works fine, I am assuming that I
: should be able to store 2^32 characters into the txtEdit.Text string
: as defined for VB for a varying string. The fact that only 2^16
: characters are stored means that the text box is being interpreted as
: a fixed string which has this smaller limit.
:
: Does anybody know how to do this?
:
: Thanks,
: xyz
:
Jul 17 '05 #2
xyz
I was able to go beyond the 64K limit by changing my controls.

Yes, it is true that the Text Box control has a 64K limit, but the
Rich Text Box control does not have this limit.

Replacing the control was relatively effortless. All I had to do was
define it as MultiLine with vertical scrollbar and to set the
RightMargin to the ScaleWidth on the Form_resize() procedure.

Thanks for the reference.

xyz.

=========
On Sat, 08 Nov 2003 00:15:00 GMT, "Randy Birch"
<rg************ @mvps.org> wrote:
While strings can be 2^32 characters, edit controls (text boxes) are limited
to 64k.

http://msdn.microsoft.com/library/de...imitations.asp


Jul 17 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
1491
by: David Rifkind | last post by:
I've seen some strange string formatting behavior on several XP and 2000 machines. I can get the same results with Graphics.DrawString, but the easiest way to see it is to put a label on a VB or C# form, leave the label's font setting at the default, set AutoSize to true, and set the text property to a long string of narrow characters, like: llllllllllllllllllllllllllllllllllllllll The first couple dozen or so 'l's look okay, but the...
3
2188
by: Marina | last post by:
Hi, When posting to a particular ASP.NET page from ASP, we get a generic DNS error when one of the form variables gets beyond around 1290 characters or so. The error can litterally be eliminated and reproduced by the deletion or addition of a single character Now, the maxrequestlength in machine.config is at 4096KB - which is around 4MB. There is no way we are going over this. And there is no .NET error - there is a generic DNS error....
9
1548
by: Kevin Hodgson | last post by:
I'm experiencing a strange Dataset Update problem with my application. I have a dataset which has a table holding a set of customer information records. (address, contact, info, etc.) I have a series of ComboBoxes (Client Number for selection), and text fields to show the other data bound to this Dataset.table If I change a value for the first client in the list, and press my update client button, the data is successfully updated to the...
2
22275
by: Daniel | last post by:
c# string size limit? length of string limit?
8
8317
by: tshad | last post by:
Is there a string limit is C#? I have a Textbox that I am allowing users to paste into (can be a word document). But I am finding that I am losing data when I write large files to my Sql Server database. The fields is set to text. The data is kept in an object in a "string" variable when I am moving from asp.net page to page. One example had the data at 23k, but when I got the data back, it only have
4
2286
by: BA | last post by:
Hello, I have a very strange code behavior that I cannot make heads or tails of: I have c# code being executed in BizTalk assemblies which is acting very strangely. In my BizTalk process I call a static method: public static string ValidateMessage(params...)
3
1426
by: Tomasz J | last post by:
Hello Developers, I have a control derived from System.Web.UI.WebControls.WebControl. Control has this property: public string Value { set { _value = value; } get { return _value; }
1
1044
by: David C | last post by:
I have an asp.net page that is adding a javascript onclick event by adding an attribute (see below). The problem is that when the file name (shown as strNewFile) has a single quote in the name (e.g. David's Document.doc) then the javascript function fails. I assume it is a string concat problem but have been unable to solve it. Any help is appreciated. David varControl = e.Item.FindControl("LBtnEmailDoc")...
7
1821
by: jacklisp | last post by:
I have wrote a small function but got the error function: /*< squeeze */ void squeeze(char s1,char s2) { int de_s ; int i,j,k; for(i = 0;s2 !='\0';++i) {
0
9563
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10145
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9998
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8822
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7366
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5406
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3917
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
3523
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2793
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.