Custom props 201 hard question

MisterX b.xavier at internet.lu
Mon Feb 23 13:29:49 EST 2004


Hi everyone,

Just hoping I can elucidate this with your help.
It's a matter of organization I need, and maybe
there's a simpler way... That would be example 1
which works. But in terms of organization, im not
really hip to it...

So here's me using custom props sets...

on initializeXOSLanguage
  repeat for each line l in fld "randomlist"
    set the XOS[l] of this stack to random(100)
  end repeat
end initializeXOSLanguage

Results in a customproperty set named XOS with a list
of custom properties (l) each with a random value. EZ...

-- but

   set the custompropertyset of this stack to "XOS"
   repeat for each line l in fld "aboutlanguages"
     put helptext into aboutlanguages[l]
   end repeat
   set the aboutlanguages of this stack to helptext

does nothing - creates the xos cps if not already there.

on initializeXOSLanguage
  set the custompropertyset of this stack to "XOS"
  put the htmltext of fld "help" into helptext
  repeat for each line l in fld "aboutlanguages"
    set the aboutlanguages[l] of this stack to helptext
  end repeat
end initializeXOSLanguage

This works but sets the aboutlanguages property as a set which contains each
"l" which contain the helptext. It is not in the xos custom set!
I believe the p[o] forces things as a c-property set which is the variable
name of the array.

  set the custompropertyset of this stack to "XOS"
  put the htmltext of fld "help" into helptext
  repeat for each line l in fld "aboutlanguages"
    put helptext into test[l] -- ex 1
    set the aboutlanguages[l] of this stack to helptext -- ex 2
  end repeat
  set the aboutlanguages of this stack to test -- ex 2

  put helptext into the aboutlanguages of this stack -- compile error
  set the xos["aboutlanguages"] of this stack to test -- compile error too

Example 1 and 2 gives you an error.

So how can I store an array into a custom property in a set?

  set the xos["aboutlanguages"] of this stack to test
  -- test is the array

I tried other combos but am really stuck...

Is there support to store an array into a custom property?

I have resolved to

  set the xos["aboutlanguages",l] of this stack to helptext

but it's ugly and requires another cps browser if
CPS XOS is to contain loads more info...
Also you can't get the keys of xos...

any solution welcome...

cheers
Xavier



More information about the use-livecode mailing list