Solved

# How to get a specified value into a ListView

Posted on 2003-03-13
Medium Priority
139 Views
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
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
• 3
• 2
• 2
• +1

LVL 6

Expert Comment

ID: 8129496
Hi krypto.

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

Markus
0

LVL 3

Accepted Solution

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

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

Markus
0

LVL 3

Expert Comment

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

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

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

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

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

ID: 9316793
krypto2000:
EXPERTS:
Post your closing recommendations!  No comment means you don't care.
0

Expert Comment

ID: 9316794
krypto2000:
EXPERTS:
Post your closing recommendations!  No comment means you don't care.
0

## Featured Post

Question has a verified solution.

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