?
Solved

How to get a specified value into a ListView

Posted on 2003-03-13
11
Medium Priority
?
139 Views
Last Modified: 2010-04-04
Hello,
I have a listbox like that :

1 -  aaaa bbbb cccc dddd eeee
2 -  ffff eeee ssss uuuu wwww
3 -  nnnn qqqq pppp hhhh tttt

i want to get the value of 'uuuu'. I know where I can get all the value present in first line, but where can I get the values present in the second line or third line ???

Thanks.
0
Comment
Question by:krypto2000
[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
  • 3
  • 2
  • 2
  • +1
11 Comments
 
LVL 6

Expert Comment

by:DaFox
ID: 8129496
Hi krypto.

MyString := ListView.Items[i].SubItems[j]; ?

Markus
0
 
LVL 3

Accepted Solution

by:
ILE earned 200 total points
ID: 8131366
VALUES OF ITEMS ARE SEPARATED BY SPACES?


IF SO THEN 100% WORKING SOLUTION S DOWN
IN I IS THE LINE IN R IS THE RECORD


FUNCTION   TFORM1.GETVALUE(I,R:INTEGER):STRING;
VAR S1,S:STRING;
     J1,J:INTEGER;
BEGIN
S1:='';
S:=LISTBOX1.ITEMS[I];
FOR J:=1 TO LENGTH(S) DO
 BEGIN
  IF S[J]=#32 THEN INC(J1);
  IF J1=R THEN  S1:=S1+S[J];
 END;
GETVALUE:=S1;
END;



0
 
LVL 6

Expert Comment

by:DaFox
ID: 8131470
ILE, your shift key is broken ;-)

Markus
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 3

Expert Comment

by:ILE
ID: 8131702
YEP BUT I CEN REPAIR IT :))

MEYBE WHEN I HAVE A TIME I WILL PRESS ON CAPS LOCK MEYBE...
0
 
LVL 6

Expert Comment

by:Stuart_Johnson
ID: 8132393
Without trying to sound critical - what does this mean?

IF SO THEN 100% WORKING SOLUTION S DOWN
IN I IS THE LINE IN R IS THE RECORD
0
 
LVL 3

Expert Comment

by:ILE
ID: 8132497
in i is the line form the listbox
and the r is the subrecord

in your example

if u try to find      u use  
 
  aaaa              getvalue(0,0)
  bbbb              getvalue(0,1)
  uuuu              getvalue(1,3)
  qqqq              getvalue(3,3)

if this is what u wont


 

0
 
LVL 6

Expert Comment

by:Stuart_Johnson
ID: 8132526
krypto2000,

Do you mean you want to return an listindex and position for a string?

So, if you wanted to find UUU, the program would return

1 and 3 (which means list index 1 and position 3)?

Please clarify your question just to make sure we're on the right path.

Stuart.
0
 

Expert Comment

by:CleanupPing
ID: 9316793
krypto2000:
This old question needs to be finalized -- accept an answer, split points, or get a refund.  For information on your options, please click here-> http:/help/closing.jsp#1 
EXPERTS:
Post your closing recommendations!  No comment means you don't care.
0
 

Expert Comment

by:CleanupPing
ID: 9316794
krypto2000:
This old question needs to be finalized -- accept an answer, split points, or get a refund.  For information on your options, please click here-> http:/help/closing.jsp#1 
EXPERTS:
Post your closing recommendations!  No comment means you don't care.
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…
Suggested Courses

770 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