how to get the value of a custom property if the name of the cProperty is in a variable?
J. Landman Gay
jacque at hyperactivesw.com
Tue Aug 8 11:25:48 EDT 2017
The answer to the first case is "don't do that". Use a different variable
name for the local.
The second case is interesting. I wouldn't mind having multiple-word
Jacqueline Landman Gay | jacque at hyperactivesw.com
HyperActive Software | http://www.hyperactivesw.com
On August 8, 2017 10:17:29 AM Mark Waddingham via use-livecode
<use-livecode at lists.runrev.com> wrote:
> On 2017-08-08 17:09, J. Landman Gay via use-livecode wrote:
>> In what circumstance would it be necessary to quote the property name?
> The original case Dr Hawkins encountered was something along the lines
> local someVar
> put 100 into someVar
> put the someVar of me
> Here, this will fetch the custom property '100'. Ideally you'd be able
> to do
> put the "someVar" of me
> Instead - the quoting indicating you want to use that *literal* value
> for the
> property name, instead of the variables context.
> Another case is wanting to fetch custom property names which contain
> chars you
> can't have in an unquoted literal:
> put the "my property name with lots of words (and parantheses) too" of
> Currently, using quoted literals in this case works for setting, but
> work for getting; and even a quoted literal will still resolve to a
> if one has been defined.
> I think the latter is probably something which is unlikely to hurt
> anyone if
> tweaked though...
> Warmest Regards,
>> On August 8, 2017 6:05:21 AM Mark Waddingham via use-livecode
>> <use-livecode at lists.runrev.com> wrote:
>>> What doesn't work at the moment is if you have a var name which is
>>> local catness
>>> put "minimal" into catness
>>> set the "catness" of me to "very much"
>>> get the customProperties of me
>>> put the keys of it
>>> Will result in a key 'minimal' and *not* 'catness' - which is perhaps
>>> not what would be expected.
>> Jacqueline Landman Gay | jacque at hyperactivesw.com
>> HyperActive Software | http://www.hyperactivesw.com
>> use-livecode mailing list
>> use-livecode at lists.runrev.com
>> Please visit this url to subscribe, unsubscribe and manage your
>> subscription preferences:
> Mark Waddingham ~ mark at livecode.com ~ http://www.livecode.com/
> LiveCode: Everyone can create apps
> use-livecode mailing list
> use-livecode at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
More information about the Use-livecode