Blitz (83/213)

From:Francis G. Loch
Date:16 May 2000 at 10:16:26
Subject:Re: Bug in Lof?

Hi Gareth,

--- Gareth Griffiths <gazchap@btinternet.com> wrote: >

>
> > If you have the examples disk from your original
> Blitz disks/CD then
> > there's a couple in amigamode/mydir#?.bb2
>
> Cool, thanks. There isn't a sort routine as well is
> there? ;) I'm gonna be
> reading in ID3 tags (from MP3's) and then sorting
> them in order of Artist,
> Title. Any ideas how? I'm crap at bubble-sorting and
> shit, despite how many
> books I have about the stuff!!! :)
>

Bubble-sorting is actually quite easy. Do something
like this:

1. Make an array of your data, e.g. 'artist$(maxnum)'
2. Repeat
3. change_made=FALSE
3. For i=1 to maxnum-1
4. If artist$(i)>artist$(i+1) ; change the >
to
5. temp$=artist$(i) ; a < if you
want
6. artist$(i)=artist$(i+1) ; it in
descending
7. artist$(i+1)=temp$ ; order
8. change_made=TRUE
9. End if
10. Next
11.Until change_made=FALSE

By doing this you cause 'higher' letters to be swapped
with 'lower' letters (e.g. 'H' being a 'higher' letter
than 'G') which is further along in the array. This
keeps on going withing the FOR...NEXT loop. If no more
changes can be made the routine exits from the
REPEAT...UNTIL loop.

If you want more (or perhaps I should say clearer)
info on bubble-sorts let me know.

I hope that helps.

Kind regards,

Francis.

=====
e-mail:- fgloch@yahoo.com
web-site:- http://www.geocities.com/fgloch
Member of GAUG
Glasgow Amiga Users Group
*-Join our mailing list-*
gaug-subscribe@egroups.com

__________________________________________________
Do You Yahoo!?
Send instant messages & get email alerts with Yahoo! Messenger.
http://im.yahoo.com/

---------------------------------------------------------------------
To unsubscribe, e-mail: blitz-list-unsubscribe@netsoc.ucd.ie
For additional commands, e-mail: blitz-list-help@netsoc.ucd.ie