?
Solved

listbox1.Items.ValueFromIndex problem ?

Posted on 2003-12-10
3
Medium Priority
?
972 Views
Last Modified: 2012-06-21
Hello Experts,
i have a listbox, there are email addresses in it as an items,
i want to take the value from a listbox item, and set it as a string which i declared earlyer let's say "email". toEmail is an integer that declares which listbox item i will use.
The problem is that if i have bbh2k3@yahoo.com in the listbox i get bh2k3@yahoo.com as a value of the email string.
It eats one character... how to fix that ?
My Code Is:
email := tolistbox.Items.ValueFromIndex[toemail];

Thanks in advance!
0
Comment
Question by:bbh2k3
[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
  • 2
3 Comments
 
LVL 26

Accepted Solution

by:
Russell Libby earned 2000 total points
ID: 9912394

The ValueFromIndex is useful when dealing with name/value pairs, which you are NOT using. What you should be using is:

email:=tolistbox.Items[toemail];

This will return the whole string back.

Regards,
Russell

0
 
LVL 27

Expert Comment

by:kretzschmar
ID: 9912405
how looks your listboxentries?
0
 
LVL 27

Expert Comment

by:kretzschmar
ID: 9912429
well, did some tests

if your entries are like

blabla=xxx

then it works correct,
but if your entry is like

xxx

then the first letter is skipped

-> conclusion
use rllibbys suggestion

meikl ;-)
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

A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…
Suggested Courses

718 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