Two Plus Two Newer Archives  

Go Back   Two Plus Two Newer Archives > Other Topics > Computer Technical Help
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 11-20-2007, 09:16 PM
ThaSaltCracka ThaSaltCracka is offline
Senior Member
 
Join Date: Sep 2003
Location: Team Slayer!
Posts: 24,282
Default Re: Anyone good at VB?

thanks again Meech. I got everything to work right, EXCEPT the sorting. Could you possibly point me in the right direction?
Reply With Quote
  #2  
Old 11-20-2007, 10:22 PM
Meech Meech is offline
Senior Member
 
Join Date: Nov 2004
Location: Meechigan
Posts: 1,159
Default Re: Anyone good at VB?

I'm a database guy so a simple "SORT BY" or more recently a [img]/images/graemlins/blush.gif[/img]rder=> gets the job done.

But sort 101 is the bubble sort. Here is an example I nabbed off the net. If you need some help adapting it, lemme know.

' Bubble Sort

Dim I, J, IntArray(), Temp as Integer ' Declare Variables

For I = 1 To Length - 1 ' Supposed to be the smaller value
For J = I To Length ' Supposed to be the larger value
If IntArray(I) > IntArray(J) Then ' Compare Cells
Temp = IntArray(I) ' \
IntArray(I) = IntArray(J) ' | Swap Cells
IntArray(J) = Temp ' /
End If
Next
Next


http://en.wikipedia.org/wiki/Bubble_sort
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 10:57 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.