Solved

Maximum Characters in a Listbox?

Posted on 1998-12-17
8
454 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Salesforce Has Never Been Easier

Improve and reinforce salesforce training & adoption using WalkMe's digital adoption platform. Start saving on costly employee training by creating fast intuitive Walk-Thrus for Salesforce. Claim your Free Account Now

 

Author Comment

by:spatel121798
ID: 1450928
Please can someone help me.
0
 
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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

726 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