|
-
Nov 21st, 2005, 08:58 PM
#1
Thread Starter
Hyperactive Member
Simple (Lowercase / uppercase) RESOLVED
I have three lists boxes.
List1 - A list of words.
ok i want to click a buttn and it will go down every word in list1 and if it contains a capital letters it gets added to list2 if it doesn';t it gets added to list1
thanks in advance
Last edited by Ricky1; Nov 21st, 2005 at 09:19 PM.
-
Nov 21st, 2005, 09:09 PM
#2
Re: Simple (Lowercase / uppercase)
Do you mean add it to List3?
You could loop thru the listbox, and compare the item to the same Ucase() item, to see if they are the same. If one has a capital letter, then they won't be.
You have List1 of words, and you want List2 to be lower case, and List3 to contain words with Capitals?
-
Nov 21st, 2005, 09:10 PM
#3
Thread Starter
Hyperactive Member
Re: Simple (Lowercase / uppercase)
-
Nov 21st, 2005, 09:10 PM
#4
Re: Simple (Lowercase / uppercase)
Loop through each item, and search it with a small loop.
VB Code:
For counter = 1 to Len(myWord)
If Asc(Mid$(myWord, counter)) >= 65 And Asc(Mid$(myWord, counter)) <= 90 Then
List2.AddItem myWord
End If
Next counter
or something like that.
-
Nov 21st, 2005, 09:14 PM
#5
Re: Simple (Lowercase / uppercase)
The last post will put the uppercase ones into List2, but David's way is better..
VB Code:
If LCase(myWord) = myWord Then
List2.AddItem myWord
Else
List3.AddItem myWord
End If
Puts any words with upper case letters in List 3, and all lower case words in list 2.
-
Nov 21st, 2005, 09:16 PM
#6
Re: Simple (Lowercase / uppercase)
This should do it.
VB Code:
Option Explicit
Private Sub Form_Load()
Dim x As Integer
For x = 0 To list1.ListCount - 1
If list1.List(x) = LCase(list1.List(x)) Then
list2.AddItem list1.List(x) ' all lowercase
Else
list3.AddItem list1.List(x) ' mixes case
End If
Next x
End Sub
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
|