|
-
Jun 11th, 2005, 05:19 PM
#1
Thread Starter
Frenzied Member
List box problems
When i have a value like Spade12 and Club1 in a list box, how do i make it so its just 12, or 1?
Thank you i advance
ILMV
-
Jun 11th, 2005, 05:28 PM
#2
Addicted Member
Re: List box problems
Hi,
Not great but you can use:
VB Code:
Dim CardVal As String
CardVal = List1.List(List1.ListIndex)
CardVal = Replace(CardVal, "Spade", "")
CardVal = Replace(CardVal, "Club", "")
CardVal = Replace(CardVal, "Diamond", "")
CardVal = Replace(CardVal, "Heart", "")
Have a good one!
BK
-
Jun 11th, 2005, 05:36 PM
#3
Thread Starter
Frenzied Member
Re: List box problems
Bit of tweaking needed but worked like a charm, i thank you.
-
Jun 13th, 2005, 08:24 AM
#4
Hyperactive Member
Re: List box problems
A tiny detail, but wouldn't
VB Code:
Dim CardVal As String
CardVal = Replace(Replace(Replace(Replace(List1.List(List1.ListIndex), "Spade", ""), "Club", ""), "Diamond", ""), "Heart", "")
be quicker?
-
Jun 13th, 2005, 07:49 PM
#5
Addicted Member
Re: List box problems
Hi,
Anguswalker:
No, there wouldn;t be any difference since the replace() is called the same number of times. It is only harder to read on one line. <g> You could always stick some timing code for each method and compare for yourself.
Have a good one!
BK
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|