Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Languages / C# / September 2007

Tip: Looking for answers? Try searching our database.

Text boxes and string length

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Lilith - 21 Sep 2007 16:04 GMT
I'm looking at practical string lengths and the capacity of a text
box.  I'm using a string to progressively add the status of a process
periodically and dumping that text into a text box.  I don't mind
trimming the first x number of lines from the string when it reaches
certain limits, but I'd like to know at what point I may be
approaching an exception being thrown, an application crash or system
memory getting consumed.

If possible, I'd also like some suggestions as to the best way to trim
the first few lines of the string, which will be delimited by \r\n.

Thanks,
Lilith
Laura T. - 21 Sep 2007 16:27 GMT
As of Win32, the normal edit box controls do not have hard limits (to be
precise, they have 2GB-1 limit...,
http://msdn2.microsoft.com/en-us/library/ms672096.aspx) the
practical(technical) limit comes, IMHO, from the available memory ad
required performance. The .NET does not seem to expose any further
limitations so it's only a memory/performance problem.
Preallocating memory may be a good thing.

From the user point of view, the ability to see 4 days old things might not
be interesting so another practical limit can come from there.

The use of indexOf()/lastIndexOf() and substring is the best I can think of
for now.
If you have some fixed lengths, you can play with count parameter of
indexOf..

> I'm looking at practical string lengths and the capacity of a text
> box.  I'm using a string to progressively add the status of a process
[quoted text clipped - 9 lines]
> Thanks,
> Lilith
Lilith - 21 Sep 2007 18:29 GMT
The time involved was another concern.  A day's worth of report is
sufficient in most circumstance.  But since this involves unmanned
monitoring, a weekend plus a day worth of data might be necessary for
the Monday morning visual check.  

Eventually I'll add some logging capability, but for now I just need
to advance the application to a usable stage.

Many thanks,
Lilith

>As of Win32, the normal edit box controls do not have hard limits (to be
>precise, they have 2GB-1 limit...,
[quoted text clipped - 25 lines]
>> Thanks,
>> Lilith
Peter Duniho - 21 Sep 2007 19:38 GMT
> The time involved was another concern.  A day's worth of report is
> sufficient in most circumstance.  But since this involves unmanned
[quoted text clipped - 3 lines]
> Eventually I'll add some logging capability, but for now I just need
> to advance the application to a usable stage.

For what it's worth, you are likely to run into usability issues LONG
before you run into any technical problems.  The TextBox control can
contain WAY more text than a user can in any sort of practical way deal
with.  This is true both from a performance point of view (initializing
and interacting with the control) as well as from the user's ability to
navigate the data.

I suspect you will find it necessary to provide a UI that allows the
user to interact with the data in more manageable pieces long before you
run out of system resources required to display the data.

Pete

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.