Can't get read/write and sorts to work

Creating Games? Developing something for fun?

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Klaus
Posts: 13806
Joined: Sat Apr 08, 2006 8:41 am
Location: Germany
Contact:

Re: Can't get read/write and sorts to work

Post by Klaus » Fri Jan 03, 2014 5:19 pm

Hi Nico,
Nico_C_GHS wrote:The items in the list are stored as " name TAB score CR" so that the list is always kept semi-neat.
ah, at last, fine! :D
Nico_C_GHS wrote:As for the code you think you've fixed, I have been trying to make sense of your final statement.
It would appear that you are trying to sort a list of scores by name for me, which is totally the opposite of what I was aiming for.
I don't understand what it was you were trying to suggest with that statement at all, could you elaborate?
I was just giving you 2 (TWO) examples on how to use the sort command 8)

To sort your list NUMERIC (item 2 of each line, which is the SCORE, right?) do this:
...
## tList = your list of highscores in the above mentioned format -> name TAB score
set itemdel to TAB
sort lines of tList numeric by item 2 of each

## Or if you want the highest scores at the top of the list:
## sort lines of tList DESCENDING numeric by item 2 of each
...
This will sort your list by, well item 2 of each line numeric :D

Check "sort container" in the dictionary!


Best

Klaus

Klaus
Posts: 13806
Joined: Sat Apr 08, 2006 8:41 am
Location: Germany
Contact:

Re: Can't get read/write and sorts to work

Post by Klaus » Tue Jan 07, 2014 2:24 pm

And, Nico, it might be a good idea to look here more often (than every three (3) weeks!)
if you have asked a question 8)

Nico_C_GHS
Posts: 44
Joined: Wed Jun 12, 2013 2:36 pm

Re: Can't get read/write and sorts to work

Post by Nico_C_GHS » Thu Jan 16, 2014 4:19 pm

I realise my actions were inefficient, however I was particularly busy for the large majority of that time. I rarely had a chance to take time out to read these forums, I apologise.
Nico Colarusso | Gracemount High School

Nico_C_GHS
Posts: 44
Joined: Wed Jun 12, 2013 2:36 pm

Re: Can't get read/write and sorts to work

Post by Nico_C_GHS » Thu Mar 06, 2014 3:19 pm

Hey all,

Quick update:

Using a mixture of your advice and the LiveCode tutorials I have got my program working :D thank you both for your help, you were fantastic. It was only with your help that this was possible and I am eternally grateful. I apologise for being frustrating and unable to follow what was said but we got there eventually :) my personal thanks again, to all that helped (Klaus and Simon).
Nico Colarusso | Gracemount High School

Post Reply

Return to “Games”