• Welcome to Valhalla Legends Archive.
 

Sorting Even From Odd?

Started by TriCk, October 26, 2003, 01:50 AM

Previous topic - Next topic

TriCk

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


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



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


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



UserLoser

#1

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

bmwrb16

intWD or something would help also

Banana fanna fo fanna

Quote from: UserLoser on October 26, 2003, 02:17 AM

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


Tip: 'Mod' gets the integer remainder from divison.

iago

This question was asked somewhere else, too.. one of them should be deleted.
This'll make an interesting test for broken AV:
QuoteX5O!P%@AP[4\PZX54(P^)7CC)7}$EICAR-STANDARD-ANTIVIRUS-TEST-FILE!$H+H*


Michael

Quote from: iago on October 27, 2003, 02:14 AM
This question was asked somewhere else, too.. one of them should be deleted.
should keep newest and most up to date one