Solved

listbox1.Items.ValueFromIndex problem ?

Posted on 2003-12-10
3
957 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 500 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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
This is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…

728 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