Valhalla Legends Forums Archive | Visual Basic Programming | Sorting Even From Odd?

AuthorMessageTime
TriCk
Ok im getting the words from a text
Then...
Im using the Split method
to Split them if they contain "; "
[code]

Word() = Split(Words, "; ")
For Wd = 0 To UBound(Word)

[/code]

This is the part where i want to separate the numbers even from odd...
Then do something like...
[code]

If Odd Then
listbox1.additem Word(Wd)
Else
listbox2.additem Word(Wd)
End If
Next Wd


[/code]
October 26, 2003, 7:50 AM
UserLoser
[code]
Word() = Split(Words, "; ")
For Wd = 0 To UBound(Word)
If (Word(Wd) Mod 2) = 1 Then
lstOddNumbers.AddItem Word(Wd)
Else
lstEvenNumbers.AddItem Word(Wd)
End If
Next Wd
[/code]
October 26, 2003, 8:17 AM
bmwrb16
intWD or something would help also
October 26, 2003, 10:41 PM
St0rm.iD
[quote author=UserLoser link=board=31;threadid=3270;start=0#msg25792 date=1067156251]
[code]
Word() = Split(Words, "; ")
For Wd = 0 To UBound(Word)
If (Word(Wd) Mod 2) = 1 Then
lstOddNumbers.AddItem Word(Wd)
Else
lstEvenNumbers.AddItem Word(Wd)
End If
Next Wd
[/code]
[/quote]

Tip: 'Mod' gets the integer remainder from divison.
October 27, 2003, 3:03 AM
iago
This question was asked somewhere else, too.. one of them should be deleted.
October 27, 2003, 8:14 AM
-MichaeL-
[quote author=iago link=board=31;threadid=3270;start=0#msg26031 date=1067242440]
This question was asked somewhere else, too.. one of them should be deleted.
[/quote]
should keep newest and most up to date one
November 2, 2003, 12:53 AM

Search