using arrays in custom properties

Tariel Gogoberidze PMDA at earthlink.net
Tue Mar 11 19:14:01 EST 2003


Message: 3
Date: Tue, 11 Mar 2003 16:27:37 +0000
Subject: Re: using arrays in custom properties
From: Ben Rubinstein <benr_mc at cogapp.com>
To: <use-revolution at lists.runrev.com>
Reply-To: use-revolution at lists.runrev.com

on Tue, 11 Mar 2003 16:27:37, Ben Rubinstein wrote

>>on 10/3/03 11:51 pm, Tariel Gogoberidze wrote
>>
>> or as alternative you can use
>> 
>> set the customkeys["x"] of object to empty
>> or
>> set the customkeys["x"] of object to NewArray


>I've tested this - it has no apparent effect.  Has it worked for you?

Oops, I'm using it with MC 2.4.2 and up. You are right, on MC 2.3.x engine
used by rev 1.x 

set the customkeys["x"] of object to empty

would not work.


Anyway, the following script is tested and should work with engine version
2.4.2 and up

In the script of the button...
on mouseUp
  answer "please choose" with "Create custom sets" or "Empty custom set" or
"Delete custom set" or "Cancel"
  if it is "Create custom sets" then
    
    repeat with j= 1 to 10
      put "Set1Array"&j into x
      repeat with i= 1 to 10
        put "Set1ArrayElement"&j&"."&i into line i of tElements
      end repeat
      set the Set1[x] of me to tElements
    end repeat
    
    repeat with j= 1 to 10
      put "Set2Array"&j into x
      repeat with i= 1 to 10
        put "Set2ArrayElement"&j&"."&i into line i of tElements
      end repeat
      set the Set2[x] of me to tElements
    end repeat
    
  else if it is "Empty custom set" then
    
    set the customkeys["Array1data"] of me to empty
    set the customkeys["Array2data"] of me to empty
    ## works with MC 2.4.2 and up
    
  else if it is "Delete custom set" then

    get the customPropertySets of me
    delete line 1 of it
    set the customPropertySets of me to it
 ## this works even with MC 2.3.x
    
  end if
end mouseUp

best regards
Tariel




More information about the use-livecode mailing list