473,383 Members | 1,832 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,383 software developers and data experts.

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.tmp" For Input As F
frmForm1!txtEdit.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 8895
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.com...
:
: 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.tmp" For Input As F
: frmForm1!txtEdit.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
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...
3
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...
9
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...
2
by: Daniel | last post by:
c# string size limit? length of string limit?
8
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...
4
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...
3
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
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...
7
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) {
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.