array info request (new thread)

Lynch, Jonathan bnz2 at cdc.gov
Mon Jul 25 15:07:19 EDT 2005


I just tested this again, and the same problem shows up...

Try clicking a button with this script:

On mouseup
  Set the custompropertyset of this stack to "my Set"
  Set the myProp of this stack to "hello"
End mouseup

Then go look at the custom properties of the stack. When I do this, I
have a custom property named "myProp" listed under the custom property
set named "my set" - but I also have a custom property named myProp
listed under the default custom property set. The first time I click the
button, "hello" is put in the myProp in the default set, and then the
second time I click the button, "hello" is put in myProp in "my set".

Weird stuff, but it goes away if the custompropertyset just has a
one-word name.

Besides, you need a one-word name if you are going to access it with
array notation: put mySet["myProp"] into field "my field"


-----Original Message-----
From: use-revolution-bounces at lists.runrev.com
[mailto:use-revolution-bounces at lists.runrev.com] On Behalf Of Lynch,
Jonathan
Sent: Monday, July 25, 2005 2:50 PM
To: How to use Revolution
Subject: RE: array info request (new thread)

I have never had a problem with multiple item arrays: myArray[1,2,3]

However, I did have a problem with a custom property set named
"Scheduled Items" - but the problem cleared up when I named it
"ScheduledItems" - I cannot remember what exactly the problem was, but I
do remember that it was not real obvious.

-----Original Message-----
From: use-revolution-bounces at lists.runrev.com
[mailto:use-revolution-bounces at lists.runrev.com] On Behalf Of Dennis
Brown
Sent: Monday, July 25, 2005 2:43 PM
To: How to use Revolution
Subject: Re: array info request (new thread)

Jonathan,

This is interesting about the 1-word names.  I have been using  
multiword names without any problems.

Do you recall exactly what the problem was?
Was it that the array did not work as advertized, or that you had  
problems with sorting keys or making the key unique?

Of course multi-item names are the normal state for a key name so  
even if my preferred simplicity of array[key1&&key2]  for custom  
property set arrays has a problem, array[key1&comma&key2] has got to  
work.

Dennis

On Jul 25, 2005, at 1:40 PM, Lynch, Jonathan wrote:
> Custom properties and custom property sets should have 1-word names.
>
> Somewhere in the docs it says otherwise, but having a space in the  
> name
> of a custom property caused me trouble at one point, which was fixed
> when I made sure it just had a single-word name.
>
>
> Another one that comes to mind is the repeat for each element control
> structure...
>
> The internal order in which keys are stored in a custom prop is not
> sorted alphabetically - so, if you need to search in order, you  
> might be
> better off doing something like this:
>
> Set the custompropertyset of me to "scheduledItems"
> Put the customkeys of me into tKeys
> Sort tKeys
> Repeat for each line L in tKeys
>   If the scheduleditems[L] of me contains "my search string" then
>     Do whatever it needs to do
>   End if
> End repeat


_______________________________________________
use-revolution mailing list
use-revolution at lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your
subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


_______________________________________________
use-revolution mailing list
use-revolution at lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your
subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution





More information about the use-livecode mailing list