Solved

Maximum Characters in a Listbox?

Posted on 1998-12-17
8
437 Views
Last Modified: 2013-12-03
Can someone tell me if there is a maximum numbers of characters that a line in a list can display - and what the max is?
0
Comment
Question by:spatel121798
  • 4
  • 2
  • 2
8 Comments
 
LVL 13

Expert Comment

by:Mirkwood
ID: 1450925
It's 64K in C++. In VB I don't know. But what is your problem?
 1000 or so characters work without any problem. More becomes useless.
0
 
LVL 2

Accepted Solution

by:
cartti earned 50 total points
ID: 1450926
The maximum number of characters per line for a listbox is 1024.

If you try to add a string greater than that length to a listbox, it will only hold the first 1024 characters.
0
 

Author Comment

by:spatel121798
ID: 1450927
I have designed a utility in VB which reads a text file into a list and strips off certain words from each line etc. I am reading the file into a list - but one sentence can be 2kb - and ive noticed that it gets truncated - because you said it can only hold 1kb. Is there a way round this?

And are there other ways of reading in files that can do specific searches per sentence?
0
 

Author Comment

by:spatel121798
ID: 1450928
Please can someone help me.
0
How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

 
LVL 2

Expert Comment

by:cartti
ID: 1450929
I'll have a think about first point.

With searches, are you talking about searching a word within a sentence, or a sentence within a file ?
0
 
LVL 13

Expert Comment

by:Mirkwood
ID: 1450930
Why not split the line every 1000 characters
0
 

Author Comment

by:spatel121798
ID: 1450931
here is an example of one of my sentences:

<Message:<GroupId:123456><Id:1><Num:11375><Date:17-Apr-1997><Time:14:39:38><Expiry:90><TranStartNum:11239><Collection:TrainingMessage><ObjectName:A_EPOSSProducts1_3011><DateChangeList:<Date:<DateName:StartDate><Type:1>>><Data:<Collection:_EPOSSProducts><ObjectName:3011_00><StartDate:16-June1997> <EndDate:><RData:<Data:<PN:3011><SN:Blu Wat><LN:Blue Sea Water><RN:Blue SeaWater><FP:False><RP:><MV:1.00><SE:In><AS:False><MnV:1.00><MxV:45.00><MnQ:1><MxQ:1><RcptNo:2><SR:True><MP:0><V:0><RV:True><RT:7><RA:APS><SI:TrainingAPScardscheme><IA:><PM:<L1:><L2:3026><L3:3006><L4:3013><L5:3017>><SM:><I:False><ST:><DEP:E><AdditionalData:<F:*><S:Numeric><D:><Max:6><Min:0><VM:><N:APSSEQ><C:><O:0><A:None><SD:>><AdditionalData:<P:TokenType:><F:*><S:Alphanumeric><D:><Max:10><Min:0><VM:><N:TT><C:><O:0><A:Display><SD:<Option:<Text:MagCard><Key:1>><Option:<Text:BarCode><Key:2>>>><AdditionalData:<F:*><S:Date><D:><Max:8><Min:0><VM:><N:AD><C:><O:0><A:None><SD:>><AdditionalData:<F:*><S:Numeric><D:><Max:6><Min:0><VM:><N:CA><C:><O:0><<AdditionalData:<P:Method of Payment:><F:*><S:Options><D:><Max:6><Min:0><VM:><N:MoP><C:MethodPayment><O:99><A:Display><SD:<Option:<Text:Cash><Key:0>><Option:<Text:Cheque><Key:1>>>><AdditionalData:<F:*><S:Alphanumeric><D:><Max:4><Min:0><VM:><N:SVC><C:><O:0><A:None><SD:>><AdditionalData:<F:*><S:Numeric><D:><Max:40><Min:0><VM:><N:CuR><C:><O:0><A:None><SD:>><AdditionalData:<F:*><S:Alphanumeric><D:><Max:4><Min:0><VM:><N:CID><C:><O:0><A:None><SD:>><AdditionalData:<F:*><S:Alphanumeric><D:><Max:2><Min:0><VM:><N:SG><C:><O:0><A:None><SD:>><AdditionalData:<F:*><S:Alphanumeric><Max:10><Min:1><N:TI><O:0><A:None>><AdditionalData:<F:*><S:Alphanumeric><Max:24><Min:1><N:TD><O:0><A:None>><AdditionalData:<F:*><S:Alphanumeric><Max:24><Min:1><N:CN><O:0><A:None>><AdditionalData:<F:*><S:Alphanumeric><Max:10><Min:1><N:TV><O:0><A:None>>>>><Version:1><CRC:C620E1DD>>

basically in this example i am searching for the word "collection" and deleting everything before it. I am also searching for other words in the sentence and stripping off everything after it.

if i was to split the lines up - how would i go about doing it. currently the code i am using to input the file is:

Do While Not EOF(fh) ' Loop until end of file.
    Line Input #fh, textline ' Read line into variable.
    FrmDisplay!List1.AddItem textline    
Loop

Thanks for the help!

0
 

Author Comment

by:spatel121798
ID: 1450932
Also, is there a way of putting a horizontal scroll on my listbox so that i can see the complete sentence?
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

I’ve seen a number of people looking for examples of how to access web services from VB6.  I’ve been using a test harness I built in VB6 (using many resources I found online) that I use for small projects to work out how to communicate with web serv…
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

760 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now