# In a simple IF statement loop

R

FOR i = 1 TO 10

IF array%(i) > highest% THEN highest% = array%(i)

NEXT

When the loop is done, you should have the highest integer in the array.

Posted on Dec 20, 2009, 9:55 AM

 Response Title Author and Date I dont know what you meen... unseenmachine on Dec 20 Don't use 50 CNT variables. Use one Array! Clippy on Dec 20 You need to learn about arrays first... Pete on Dec 20 getting there...but... unseenmachine on Dec 20 Array sample showing high and low values Solitaire on Dec 20 Here's how it would work with your program: Solitaire on Dec 20 Thanks, but.... unseenmachine on Dec 20 Sure. Here is the Bubble Sort algorithm: Solitaire on Dec 20 * Ever hear of SWAP? You is doin it in VB :-P Clippy on Dec 20 You're right, Clippy. Solitaire on Dec 20 * I found that out in VB6. I swapped like you did. Clippy on Dec 20 But you use bubble sort qbguy on Dec 21 The one I posted was even easier... Pete on Dec 21 * But that one's just a less optimized bubble sort qbguy on Dec 21 So? Pete on Dec 21 * Because it is NOT "intuative" to a new programmer. Clippy on Dec 21 Am i the programmer in question? unseenmachine on Dec 21 Not really. There are dozens of ways to SORT. Some are not easy to understand. Clippy on Dec 21 I've been coding more years than you've been alive. Pete on Dec 21 How is bubble sort more intuitive than selection sort? qbguy on Dec 21 * I use shell sort without a problem. Not everything involves vast arrays. Clippy on Dec 21 Why would you want to change the array data? Clippy on Dec 20 The purpose of it all...well some of it anyway unseenmachine on Dec 20 The ten most likely would probably be the least used balls, but Clippy on Dec 20 Fun to program but fruitless to use. Pete on Dec 21 Fot those who are not english unseenmachine on Dec 21 * I thought for the lottery the order doesn't matter though qbguy on Dec 21 * Up with disorderly balls the Engish will not put! Sir Winston on Dec 21 * Just switch < to > 'get the lowest' to 'get the highest' and 1 to 10 for results. Pete on Dec 21 Done, well to a fashion unseenmachine on Dec 21 * Well I think that is more than 50 numbers. Clippy on Dec 21 Re. more than 50 numbers unseenmachine on Dec 21 Of course! Solitaire on Dec 22