setprops, which property?

Dave Cragg dcragg at lacscentre.co.uk
Mon May 6 16:20:01 EDT 2002


At 1:05 pm -0700 6/5/02, Niklas "Almesj–" wrote:
>Thanks Ken,
>That is my experience aswell.. Which makes me wonder how I can use
>setProps with a custompropertyset (since I can't get setprops to work with
>the name of the either, once a custompropertyset has been assigned)?
>
>cheers,
>/Niklas
>
>From: "Ken Ray" <kray at sonsothunder.com>
>To: <use-revolution at lists.runrev.com>
>Subject: Re: setprops, which property?
>Date: Sun, 5 May 2002 15:57:14 -0500
>Organization: Sons of Thunder Software
>Reply-To: use-revolution at lists.runrev.com
>
>Niklas,
>
>I don't think there is currently a way to do that. If you have:
>
>setProp myArray theValue
>   -- stuff here
>   pass myArray
>end myArray
>
>... and you execute "set the myArray[10] of this stack to 100", you will
>trigger the setProp handler, and 'theValue' will contain '100', but you
>won't be able to retrieve the '10' key.
>
>Am I wrong? I'd love it if I were...


Sorry. I missed the beginning of this. Is this what you need?

on mouseUp
  set the myArray["age"] of me to "very old"
end mouseUp

setprop myArray[whichKey] pValue
  switch whichKey
   case "name"
    answer "Your name is" && pValue
    break
   case "age"
    answer "You are" && pValue
    break
   end switch
end myArray

Cheers
Dave Cragg



More information about the use-livecode mailing list