# get total number of data lines entered # by using the "date" array $totalentries = $#date; # move it up one to make the count accurate $totalentries = $totalentries + 1; # Bubble Sort Data # set a Flag $flag = 1; until ($flag == 0) { $n = 0; $counter = $totalentries; $flag = 0; # the flag is changed from 1 to 0. # Not sure if the "until" function will drop out # at this point or not. Don't know a better way. . . while ($counter > 0) { $n2 = $n + 1; if (int $date[$n] < int $date[$n2]) { # if this is true, perform the swap of # the same elements in each array $placeholder = $date[$n]; $date[$n] = $date[$n2]; $date[$n2] = $placeholder; $placeholder = $provider[$n]; $provider[$n] = $provider [$n2]; $provider[$n2] = $placeholder; $placeholder = $description[$n]; $description[$n] = $description[$n2]; $description[$n2] = $placeholder; $placeholder = $exhibit[$n]; $exhibit[$n] = $exhibit[$n2]; $exhibit[$n2] = $placeholder; $placeholder = $page[$n]; $page[$n] = $page[$n2]; $page[$n2] = $placeholder; # if a change occurred, change the flag to "1" $flag = 1; } ++$n; --$counter; } }