• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 140
  • Last Modified:

How to get a specified value into a ListView

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
krypto2000
Asked:
krypto2000
  • 3
  • 2
  • 2
  • +1
1 Solution
 
DaFoxCommented:
Hi krypto.

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

Markus
0
 
ILECommented:
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
 
DaFoxCommented:
ILE, your shift key is broken ;-)

Markus
0
Technology Partners: 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!

 
ILECommented:
YEP BUT I CEN REPAIR IT :))

MEYBE WHEN I HAVE A TIME I WILL PRESS ON CAPS LOCK MEYBE...
0
 
Stuart_JohnsonCommented:
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
 
ILECommented:
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
 
Stuart_JohnsonCommented:
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
 
CleanupPingCommented:
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
 
CleanupPingCommented:
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

[Webinar On Demand] Database Backup and Recovery

Does your company store data on premises, off site, in the cloud, or a combination of these? If you answered “yes”, you need a data backup recovery plan that fits each and every platform. Watch now as as Percona teaches us how to build agile data backup recovery plan.

  • 3
  • 2
  • 2
  • +1
Tackle projects and never again get stuck behind a technical roadblock.
Join Now