Why is sort starting at the bottom of a field?

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller

Post Reply
sphere
Posts: 1145
Joined: Sat Sep 27, 2014 10:32 am

Why is sort starting at the bottom of a field?

Post by sphere » Wed Oct 29, 2014 6:32 pm

Hello, i need a little help.
Why is the command sort staring at the bottom when sorting a-z?
If i use descending then it starts at the top of the field but sorts z-a.

Code: Select all

on mouseUp 
 sort field "blabla" ascending text 
end mouseUp
How should it be when starting at the top and a-z?
The dictionary doesn't bring me much further.

Thansk for any help.

sphere
Posts: 1145
Joined: Sat Sep 27, 2014 10:32 am

Re: Why is sort starting at the bottom of a field?

Post by sphere » Wed Oct 29, 2014 10:24 pm

what the H*** :roll:

ok must be something in my script or so

as i take a new stack just to test this it works ok.

:idea: Figuring out mode ON :idea:

Klaus
Posts: 14199
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: Why is sort starting at the bottom of a field?

Post by Klaus » Wed Oct 29, 2014 11:00 pm

Gremlins! :D

jacque
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 7393
Joined: Sat Apr 08, 2006 8:31 pm
Contact:

Re: Why is sort starting at the bottom of a field?

Post by jacque » Thu Oct 30, 2014 4:51 pm

I'm trying to figure out what "start at the bottom" means.
Wait, do you mean there are blank lines at the top before the actual sorted text begins? Empty lines sort before anything else. Remove them before sorting. One way:

Code: Select all

filter tText without empty
sort lines of tText
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com

sphere
Posts: 1145
Joined: Sat Sep 27, 2014 10:32 am

Re: Why is sort starting at the bottom of a field?

Post by sphere » Thu Oct 30, 2014 7:31 pm

Hi Jacqueline, yes that's exactly what happened.
As i was figuring out how to let the input field react on the enter key, so that an user can add the line of text to the field instead of having to click on the button ADD, this added empty lines to the field, because it was only reacting after a few times hitting the enter key. So temporarely turned that piece of code off, so that first sorting is working.

Thanks a lot for your code i will test this right away.

After that i have to sort out how to let the cursor jump to line when the first letter of an email address is hit. First i had to find that the added lines to the field can't be overwritten by entering text, i found that in the property's of the field.

BUt one step at a time, i allready came far in such a short amount of time. Getting the results makes it even more fun :)

Thanks !

Post Reply