Solved

Maximum Characters in a Listbox?

Posted on 1998-12-17
8
446 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
VMware Disaster Recovery and Data Protection

In this expert guide, you’ll learn about the components of a Modern Data Center. You will use cases for the value-added capabilities of Veeam®, including combining backup and replication for VMware disaster recovery and using replication for data center migration.

 

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

What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

Question has a verified solution.

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

Suggested Solutions

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…
You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

773 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