The Daily Click ::. Forums ::. Klik Coding Help ::. Arranging things alphabetically/numerically
 

Post Reply  Post Oekaki 
 

Posted By Message

Muz



Registered
  14/02/2002
Points
  6499

VIP MemberI'm on a BoatI am an April FoolHonored Admin Alumnus
28th March, 2008 at 00:04:25 -

I want my application to take the all the names of groups in an INI file and arrange them alphabetically. How do I do that? Any extensions that do the trick or a condition or action I missed?

Thanks in advance

 
Disclaimer: Any sarcasm in my posts will not be mentioned as that would ruin the purpose. It is assumed that the reader is intelligent enough to tell the difference between what is sarcasm and what is not.

Image

Cecilectomy

noPE

Registered
  19/03/2005
Points
  305

Has Donated, Thank You!VIP MemberWeekly Picture Me This Winner!Cardboard BoxGhostbuster!Pokemon Ball!ComputerBox RedSanta HatSnowman
I am an April Fool
28th March, 2008 at 00:16:53 -

easy!

heres the c++ way to do it lol. i just learned this.
numerically is easy in mmf. alhabetically may be tougher. is there a way to compare strings in mmf?


void sort(int a[], int words)//the array 'a' is the index of all the numbers to be sorted.
{
for (int k = 1; k < words; k++)
{
for (int r = 0; r < words - k; r++)
{
if (a[r] > a[r + 1])//compares the if the current number in the index[r] is greater than the next.
{
swap(a[r], a[r + 1]);//swaps the position of the two numbers if it is
}
}
}
}


 
n/a

Muz



Registered
  14/02/2002
Points
  6499

VIP MemberI'm on a BoatI am an April FoolHonored Admin Alumnus
28th March, 2008 at 01:55:10 -

Deja vu, I did that for my C++ class last year

So, um, how do you translate that into MMF?


 
Disclaimer: Any sarcasm in my posts will not be mentioned as that would ruin the purpose. It is assumed that the reader is intelligent enough to tell the difference between what is sarcasm and what is not.

Image

Retainer



Registered
  02/06/2005
Points
  218
28th March, 2008 at 02:16:40 -

You could squeeze all the "things" into a Magic Deque, one of my favorite objects. They can sort both strings and numbers, but there are a lot of alternative ways. You could use Sort X, Stringsort X, Dynamic Array, or write your own with a standard array using cec!ls example

But I recommend learning Magic Deque thoroughly. Very powerful object.

Image Edited by the Author.

Image Edited by the Author.

 
Alien Invasion. Going forward!
http://www.create-games.com/project.asp?id=1092

Muz



Registered
  14/02/2002
Points
  6499

VIP MemberI'm on a BoatI am an April FoolHonored Admin Alumnus
28th March, 2008 at 02:57:18 -

Thanks! I'll try that. MMF has too many extensions, lol. I used to download all of them, hoping to use them when I need them, but I never remember which of them can do what I want them to do.

 
Disclaimer: Any sarcasm in my posts will not be mentioned as that would ruin the purpose. It is assumed that the reader is intelligent enough to tell the difference between what is sarcasm and what is not.

Image
   

Post Reply



 



Advertisement

Worth A Click