Legend has it that if you stand in front of a mirror, any time past midnight, and say three times; "I don't believe in the Bell Witch" - the next morning you will wakeup with finger nail scratches on your cheek.
Legend has it that if you stand in front of a mirror, any time past midnight, and say three times; "I don't believe in the Bell Witch" - the next morning you will wakeup with finger nail scratches on your cheek.
Do you have any more of those pills?
And, can I have some??
<br>
DT
> next morning you will wakeup with finger nail scratches on your cheek.
... and there I was wondering why I never get dated more than once!
Hello.
I apologize for reviving old thread but forum is already crowded with so many topics I don't want to aggrandize it further.
In mrs. Melanie's routine I don't understand the following:
As I see it, after the first pass through the loop CounterA is 1, so when it hits IF CounterA>0... wouldn't that make CounterA bigger than15 and exit the loop (CounterA war byte so 1-2=255)?Code:SortArray: ... IF CounterA>0 then CounterA=CounterA-2 ... CounterA=CounterA+1 IF CounterA<15 THEN SortArray
Can someone please explain it to me?
>Mrs Melanie!
Don't marry me off yet - I'm having way too much fun being single!
This is a SWAP SORT routine with an Array of 16 elements... (this version is in ASCENDING order, ie the smallest value will end up in RawData(0) and the largest value will end up RawData(15).
First time through the loop CounterA=0 (not 1 as you stated).
You compare RawData(1) with RawData(0) and if RawData(1) is smaller you swap them (NOT if it's bigger or if is the same).
There was an ARRAY BUG in PBP V2.42, which caused problems with Array manipulation - for example RawData(CounterA+1), the workaround (before MeLabs fixed it) was to add a dummy proceedure, so this became RawData(CounterA+1+0). This BUG has long been fixed, so you don't actually need the +0 bit nowadays.
Only if you are NOT at the start of the Array Sort (ie CounterA>0) do you then go back and look at the previous set of Array elements and compare those again (because you've just swapped the upper one of them). You actually subtract 2, because the very next step adds one, so in essence you only go back one Array step. If you are already at the beginning of the Array (ie CounterA=0), you DON'T step back, because that will cause you to step outside your array limits, so you move forward by adding 1 to CounterA.
You repeat the process until you've scanned the whole array and CounterA=15 (your upper Array limit).
So... back to your question...
Whether you SWAP or NOT, if CounterA=0 then the -2 will never happen, you can only move FORWARDS to CounterA=1 (ie CounterA=CounterA+1).
If CounterA=1, then if you DON'T Swap, you move FORWARDS (as above), but if you DO SWAP then CounterA will move BACK by ONE Count (ie CounterA=-2+1), which if CounterA was 1 to start with, it will now move back to be Zero.
Please accept my apology, English is not my native language so I make many mistakes.Don't marry me off yet - I'm having way too much fun being single!
Thank you very much for your kind and patient response. Now I see how stupid my question really was. I grasped on CounterA+1 & CounterA-2 as a bull on red flag therefore completely dropping the rest out of my sight. I'll put more effort next time instead of bothering with a silliness.
Thanks again for the explanation, as well for sharing the routine.
Kind regards
Bookmarks