Page 1 of 1

Another array question

Posted: Sat Jul 14, 2007 9:00 pm
by kpeters
I believe that custom properties are implemented as arrays.

Then why is tmp empty?

Code: Select all

  put the WorkCodes of button "WorkCodes" into tmp
  combine tmp using comma
  answer tmp
Needless to say, there are tons of WorkCodes...

TIA,
Kai

Posted: Sat Jul 14, 2007 10:19 pm
by Mark
Dear Kai,

Is comma the correct main delimiter? Aren't there returns in the data? Maybe you want

combine tmp by return and comma

Is the workcodes a custom property with data in it or is it a custom properties set?

Best,

Mark

Posted: Sat Jul 14, 2007 10:58 pm
by kpeters
Mark ~

WorkCodes is a custom properties set.

In there, keys are strings like "Group Activity" and values are short codes matching the keys - in the case here, "GA"

Kai

Posted: Sat Jul 14, 2007 11:13 pm
by Mark
OK Kai, then it is a two-dimensional array, which means that you need two delimiters.

combine tmp by return and comma

or

combine tmp by return and tab

Best,

Mark

Posted: Sat Jul 14, 2007 11:35 pm
by kpeters
Mark ~

doesn't work that way either.

Besides, shouldn't you be able to flatten a two-dimensional array either way (notwithstanding that the results may not be what you desire) - but it should never return empty.....

Kai

Posted: Sat Jul 14, 2007 11:54 pm
by Mark
wait a sec, Kai.... I asked whether it is a custom properties set for a reason. Please, check out the information about the customProperties property in the docs.

Best,

Mark

Re: Another array question

Posted: Sun Jul 15, 2007 1:04 am
by Mark Smith
When referring to a custom property set, you have to use this form:

put the customProperties["WorkCodes"] of btn "WorkCodes" into tmp


The form you've used looks for an element of the current set with the key "WorkCodes", and since there isn't such an element, it returns empty.

Best,

Mark

Posted: Sun Jul 15, 2007 2:04 am
by kpeters
Thanks, Mark ~

was used to doing work after issueing a

Code: Select all

  set the customPropertySet of button "WorkCodes"  to "WorkCodes"
- that did cloud my brain!

Kai