Sorting a string of data, cant figure it out

Technical support and scripting issues

Moderators: JRL, Dorian (MJT support)

Post Reply
krgkrgkrg

Sorting a string of data, cant figure it out

Post by krgkrgkrg » Thu Nov 11, 2004 5:56 pm

I need to sort data and am unable to figure it out. The information to be sorted is as follows.

Each piece of data contains: Ranking Number & Information about it
I have about 2000 pieces of data and just need the top 100 rankings with the related Information.

I hope that makes sense. My macro calculates the ranking number currently and I am just using a crude sorting process with if then statments in the Macro language. It would be too much scripting to have it hold 100 stocks, currently it just does 10.

For more info or an answer please post a reply or email me: [email protected]

Kris

User avatar
support
Automation Wizard
Posts: 1450
Joined: Sat Oct 19, 2002 4:38 pm
Location: London
Contact:

Post by support » Thu Nov 11, 2004 6:37 pm

Hi,

I would put the list into an array and then write a bubble sort algorithm. Either in MacroScript or VBScript. Search google for "bubble sort".
MJT Net Support
[email protected]

krgkrgkrg

figured out

Post by krgkrgkrg » Wed Nov 17, 2004 12:43 pm

Well with your advice I looked up BUBBLE SORT and figured out a nice and efficient means of doing this with in the macro language. Thank you for the advice.

~Kris

Post Reply
Sign up to our newsletter for free automation tips, tricks & discounts