Solved

listbox1.Items.ValueFromIndex problem ?

Posted on 2003-12-10
3
943 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
  • 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…
A short film showing how OnPage and Connectwise integration works.

930 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now