Array problem

Ken Ray kray at sonsothunder.com
Sun Jul 7 08:35:01 EDT 2002


Yves,

As long as cPoints only has student data (i.e. every element in cPoints is
what you'll be checking), you can do this:

put "" into myList
put 1 into elementNum
repeat for each element e in cPoints
  if e >= 5 then
    put line elementNum of keys(cPoints) & cr after myList
  end if
  add 1 to elementNum
end repeat

Hope this helps,

Ken Ray
Sons of Thunder Software
Email: kray at sonsothunder.com
Web Site: http://www.sonsothunder.com/


----- Original Message -----
From: "yves COPPE" <yvescoppe at skynet.be>
To: <use-revolution at lists.runrev.com>
Sent: Sunday, July 07, 2002 3:00 AM
Subject: Array problem


> Hello,
>
>
> I have a customproperty set : cPoints
>
> each key is the name of a student and each value show the points on ten
>
> f. ex. :
> get the cPoints["Lennon John"]  --> gives 6
> get the cPoints["Harrisson George"]  --> gives 8
>
> So I'd like to search all the students who have 5 or more points
>
> I make a script with the combine command using return and comma to
> make a text file and then with "repeat" I get what I search :
>
> repeat for each line L in tresult
>     if item 2 of L " 5 then put L&cr after myList
> end repeat
> delete last char of myList
>
> and it works good.
>
> Is there a way to get the same but on a faster way ??
>
> --
> Greetings.
>
> Yves COPPE
>
> Email : yvescoppe at skynet.be
> _______________________________________________
> use-revolution mailing list
> use-revolution at lists.runrev.com
> http://lists.runrev.com/mailman/listinfo/use-revolution
>




More information about the use-livecode mailing list