Re: how to get the value of a custom property if the name of the cProperty is in a variable?

classic Classic list List threaded Threaded
19 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: how to get the value of a custom property if the name of the cProperty is in a variable?

** Clarence P Martin ** via use-livecode
Two examples for testing ambiguity.

[a]
  set "8.1" of me to "I dreamt to be quoted"
  set 8.1 of me to "I dreamt to be 8.2"
  put the customProperties of me into cp
  put cp["8.1"] &" : "& cp[8.1] &" : "& cp[8+1/10]
Test and then interchange the first two lines and test again.

[b]
  set "G&T" of me to "I dreamt to be geometry and trigonometry"
  put the customProperties of me into cp
  put cp["G&T"]


_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: how to get the value of a custom property if the name of the cProperty is in a variable?

** Clarence P Martin ** via use-livecode
On 2017-08-08 12:43, hh via use-livecode wrote:

> Two examples for testing ambiguity.
>
> [a]
>   set "8.1" of me to "I dreamt to be quoted"
>   set 8.1 of me to "I dreamt to be 8.2"
>   put the customProperties of me into cp
>   put cp["8.1"] &" : "& cp[8.1] &" : "& cp[8+1/10]
> Test and then interchange the first two lines and test again.
>
> [b]
>   set "G&T" of me to "I dreamt to be geometry and trigonometry"
>   put the customProperties of me into cp
>   put cp["G&T"]

So this does work as 'expected' currently. i.e. You can use a quoted or
unquoted literal for a custom property name, and it will use the literal
appropriately.

What doesn't work at the moment is if you have a var name which is
quoted:

   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.

Warmest Regards,

Mark.

--
Mark Waddingham ~ [hidden email] ~ http://www.livecode.com/
LiveCode: Everyone can create apps

_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: how to get the value of a custom property if the name of the cProperty is in a variable?

** Clarence P Martin ** via use-livecode
In what circumstance would it be necessary to quote the property name?


On August 8, 2017 6:05:21 AM Mark Waddingham via use-livecode
<[hidden email]> wrote:

> What doesn't work at the moment is if you have a var name which is
> quoted:
>
>    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         |     [hidden email]
HyperActive Software           |     http://www.hyperactivesw.com



_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: how to get the value of a custom property if the name of the cProperty is in a variable?

** Clarence P Martin ** via use-livecode
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
of:

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
me

Currently, using quoted literals in this case works for setting, but
doesn't
work for getting; and even a quoted literal will still resolve to a
variable
if one has been defined.

I think the latter is probably something which is unlikely to hurt
anyone if
tweaked though...

Warmest Regards,

Mark.

>
> On August 8, 2017 6:05:21 AM Mark Waddingham via use-livecode
> <[hidden email]> wrote:
>
>> What doesn't work at the moment is if you have a var name which is
>> quoted:
>>
>>    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         |     [hidden email]
> HyperActive Software           |     http://www.hyperactivesw.com
>
>
>
> _______________________________________________
> use-livecode mailing list
> [hidden email]
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode

--
Mark Waddingham ~ [hidden email] ~ http://www.livecode.com/
LiveCode: Everyone can create apps

_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: how to get the value of a custom property if the name of the cProperty is in a variable?

** Clarence P Martin ** via use-livecode
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
property names.

--
Jacqueline Landman Gay         |     [hidden email]
HyperActive Software           |     http://www.hyperactivesw.com



On August 8, 2017 10:17:29 AM Mark Waddingham via use-livecode
<[hidden email]> 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
> of:
>
> 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
> me
>
> Currently, using quoted literals in this case works for setting, but
> doesn't
> work for getting; and even a quoted literal will still resolve to a
> variable
> if one has been defined.
>
> I think the latter is probably something which is unlikely to hurt
> anyone if
> tweaked though...
>
> Warmest Regards,
>
> Mark.
>
>>
>> On August 8, 2017 6:05:21 AM Mark Waddingham via use-livecode
>> <[hidden email]> wrote:
>>
>>> What doesn't work at the moment is if you have a var name which is
>>> quoted:
>>>
>>>    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         |     [hidden email]
>> HyperActive Software           |     http://www.hyperactivesw.com
>>
>>
>>
>> _______________________________________________
>> use-livecode mailing list
>> [hidden email]
>> Please visit this url to subscribe, unsubscribe and manage your
>> subscription preferences:
>> http://lists.runrev.com/mailman/listinfo/use-livecode
>
> --
> Mark Waddingham ~ [hidden email] ~ http://www.livecode.com/
> LiveCode: Everyone can create apps
>
> _______________________________________________
> use-livecode mailing list
> [hidden email]
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode



_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: how to get the value of a custom property if the name of the cProperty is in a variable?

** Clarence P Martin ** via use-livecode
On 2017-08-08 17:25, J. Landman Gay via use-livecode wrote:
> The answer to the first case is "don't do that". Use a different
> variable name for the local.

Well, yes, that is certainly one way to look at it!

However, *usually* quotes are used to ensure something is treated as
the literal value so my general feeling (since quoted property names
only work in some situations) is that this is actually an error, and was
never intended. Indeed, it comes down to *not* checking whether
something
is an IDENTIFIER or a STRING in the parsing code before looking up a
variable.

(Of course, I'm now going to go off and see if you can use quoted
variables in other places - I bet that's going to a 50/50 chance in
every
place!)

> The second case is interesting. I wouldn't mind having multiple-word
> property names.

Its not just that - it allows you to not have to use variable
indirection
if your property names aren't identifiers too.

Of course, if were all good pandas we'd probably try and avoid using
anything
other than (single) identifiers and were never the same as any local,
script local
or global variable name...

Warmest Regards,

Mark.

> --
> Jacqueline Landman Gay         |     [hidden email]
> HyperActive Software           |     http://www.hyperactivesw.com
>
>
>
> On August 8, 2017 10:17:29 AM Mark Waddingham via use-livecode
> <[hidden email]> 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
>> of:
>>
>> 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
>> me
>>
>> Currently, using quoted literals in this case works for setting, but
>> doesn't
>> work for getting; and even a quoted literal will still resolve to a
>> variable
>> if one has been defined.
>>
>> I think the latter is probably something which is unlikely to hurt
>> anyone if
>> tweaked though...
>>
>> Warmest Regards,
>>
>> Mark.
>>
>>>
>>> On August 8, 2017 6:05:21 AM Mark Waddingham via use-livecode
>>> <[hidden email]> wrote:
>>>
>>>> What doesn't work at the moment is if you have a var name which is
>>>> quoted:
>>>>
>>>>    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         |     [hidden email]
>>> HyperActive Software           |     http://www.hyperactivesw.com
>>>
>>>
>>>
>>> _______________________________________________
>>> use-livecode mailing list
>>> [hidden email]
>>> Please visit this url to subscribe, unsubscribe and manage your
>>> subscription preferences:
>>> http://lists.runrev.com/mailman/listinfo/use-livecode
>>
>> --
>> Mark Waddingham ~ [hidden email] ~ http://www.livecode.com/
>> LiveCode: Everyone can create apps
>>
>> _______________________________________________
>> use-livecode mailing list
>> [hidden email]
>> Please visit this url to subscribe, unsubscribe and manage your
>> subscription preferences:
>> http://lists.runrev.com/mailman/listinfo/use-livecode
>
>
>
> _______________________________________________
> use-livecode mailing list
> [hidden email]
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode

--
Mark Waddingham ~ [hidden email] ~ http://www.livecode.com/
LiveCode: Everyone can create apps

_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: how to get the value of a custom property if the name of the cProperty is in a variable?

** Clarence P Martin ** via use-livecode
On 2017-08-08 17:33, Mark Waddingham via use-livecode wrote:
> (Of course, I'm now going to go off and see if you can use quoted
> variables in other places - I bet that's going to a 50/50 chance in
> every
> place!)

Okay - so:

   the <quoted-or-unquoted-literal> of ...

Is the *only* place where a check to make sure something is an unquoted
literal before looking up a var *is not* done... So I think this was
probably
*not* intended and is a mistake. i.e.

   the "foobar" of ...

Should actually throw an error at the moment!

Warmest Regards,

Mark.

--
Mark Waddingham ~ [hidden email] ~ http://www.livecode.com/
LiveCode: Everyone can create apps

_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: how to get the value of a custom property if the name of the cProperty is in a variable?

** Clarence P Martin ** via use-livecode
In reply to this post by ** Clarence P Martin ** via use-livecode
famous last words. :-)

Bob S


> On Aug 8, 2017, at 08:15 , Mark Waddingham via use-livecode <[hidden email]> wrote:
>
> I think the latter is probably something which is unlikely to hurt anyone if
> tweaked though...
>
> Warmest Regards,
>
> Mark.
>


_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: how to get the value of a custom property if the name of the cProperty is in a variable?

** Clarence P Martin ** via use-livecode
In reply to this post by ** Clarence P Martin ** via use-livecode
> JLG wrote:
> In what circumstance would it be necessary to quote the property name?

Use "&" in a key, for example the "G&T" of me

> Mark wrote:
> What doesn't work at the moment is if you have a var name which is
> quoted:
>
> 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.

From a viewpoint of the "get property /set property" syntax
"unexpected results" sounds convincing here, but, TMHO, it is
exactly what I would expect from a **viewpoint of array syntax**.

on mouseUp
  local catness
  put "minimal" into catness
  --> Then the next two lines
  set the minimal of me to "very much"    --(1)
  set the "minimal" of me to "very much"  --(2)
  --> are equivalent and create the same key "minimal".
  --> As catness is "minimal" and is NOT empty, this is also equivalent to
  set the catness of me to "very much"    --(3)
  --> what is, as usual when quoting, equivalent to
  set the "catness" of me to "very much"  --(4)
  --> Four equivalent commands (1)-(4) result in the same key "minimal".
  --> And it["catness"] is empty, correctly.
  get the customProperties of me
  put it["catness"] &"/"& it[catness] &"/"& it["minimal"] &"/"& it[minimal]
  put cr & the keys of it after msg
end mouseUp



_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: how to get the value of a custom property if the name of the cProperty is in a variable?

** Clarence P Martin ** via use-livecode
In reply to this post by ** Clarence P Martin ** via use-livecode
On 2017-08-08 17:46, Bob Sneidar via use-livecode wrote:
> famous last words. :-)

Indeed - perhaps a slight case of over-optimism on my part...

:'(

Mark.

--
Mark Waddingham ~ [hidden email] ~ http://www.livecode.com/
LiveCode: Everyone can create apps

_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: how to get the value of a custom property if the name of the cProperty is in a variable?

** Clarence P Martin ** via use-livecode
In reply to this post by ** Clarence P Martin ** via use-livecode
Again, don't do that.

Years ago I knew a woman who wanted to use special characters on her mac for file names which were perfectly legal with HFS, but NOT legal for NTFS. When we moved her files to a Windows share, some of her files, though visible, were inaccessible. (Why Windows even allowed the files to be written without some kind of warning is another mystery).

So I tried to tell her to only use letters, numbers, spaces (if she had to), dashes and underscores. She would not listen. She insisted on naming files her own special way and would not change, but still wanted me to "make it work". <sigh>

Bob S


> On Aug 8, 2017, at 08:49 , hh via use-livecode <[hidden email]> wrote:
>
>> JLG wrote:
>> In what circumstance would it be necessary to quote the property name?
>
> Use "&" in a key, for example the "G&T" of me


_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: how to get the value of a custom property if the name of the cProperty is in a variable?

** Clarence P Martin ** via use-livecode
In reply to this post by ** Clarence P Martin ** via use-livecode
On 08/08/2017 08:49 AM, hh via use-livecode wrote:
>> JLG wrote:
>> In what circumstance would it be necessary to quote the property name?
>
> Use "&" in a key, for example the "G&T" of me

Is there any use case where punctuation in a property name is a good idea?

--
  Mark Wieder
  [hidden email]

_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: how to get the value of a custom property if the name of the cProperty is in a variable?

** Clarence P Martin ** via use-livecode
In reply to this post by ** Clarence P Martin ** via use-livecode
On 2017-08-08 17:49, hh via use-livecode wrote:

> From a viewpoint of the "get property /set property" syntax
> "unexpected results" sounds convincing here, but, TMHO, it is
> exactly what I would expect from a **viewpoint of array syntax**.
>
> on mouseUp
>   local catness
>   put "minimal" into catness
>   --> Then the next two lines
>   set the minimal of me to "very much"    --(1)
>   set the "minimal" of me to "very much"  --(2)
>   --> are equivalent and create the same key "minimal".
>   --> As catness is "minimal" and is NOT empty, this is also equivalent
> to
>   set the catness of me to "very much"    --(3)
>   --> what is, as usual when quoting, equivalent to
>   set the "catness" of me to "very much"  --(4)
>   --> Four equivalent commands (1)-(4) result in the same key
> "minimal".
>   --> And it["catness"] is empty, correctly.
>   get the customProperties of me
>   put it["catness"] &"/"& it[catness] &"/"& it["minimal"] &"/"&
> it[minimal]
>   put cr & the keys of it after msg
> end mouseUp

Perhaps I'm misunderstanding your point here, but I think array syntax
actually helps justify why the current behavior is wrong. Compare:

put 100 into redvalue
put 0 into myArray[redvalue]
put 255 into myArray["redvalue"]

To:

put 100 into redvalue
set the redvalue of me to 0
set the "redvalue" of me to 255

In the first case you get an array { 100: 0, redvalue: 255 }.

In the second case the customprops array is { 100: 255 }.

Basically everywhere else quoted literals evaluate to the quoted value -
unquoted literals might evaluate to the contents of a variable if that
variable has been created. In this case (in 'the ... of ...'), though,
the quoted literal gets treated as if it doesn't have quotes all the
time.

Warmest Regards,

Mark.

--
Mark Waddingham ~ [hidden email] ~ http://www.livecode.com/
LiveCode: Everyone can create apps

_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: how to get the value of a custom property if the name of the cProperty is in a variable?

** Clarence P Martin ** via use-livecode
I agree here with Mark that this is an oversight, an aberration. It should't work the way it presently does, and I would not count on it being this way forever. Some other issue may arise in the future requiring someone to "fix this" and your code will break.

Swim away from the other fish if you like, but beware of the sharks lurking about.

Bob S


> On Aug 8, 2017, at 09:00 , Mark Waddingham via use-livecode <[hidden email]> wrote:
>
> Perhaps I'm misunderstanding your point here, but I think array syntax actually helps justify why the current behavior is wrong. Compare:
>
> put 100 into redvalue
> put 0 into myArray[redvalue]
> put 255 into myArray["redvalue"]
>
> To:
>
> put 100 into redvalue
> set the redvalue of me to 0
> set the "redvalue" of me to 255
>
> In the first case you get an array { 100: 0, redvalue: 255 }.
>
> In the second case the customprops array is { 100: 255 }.
>
> Basically everywhere else quoted literals evaluate to the quoted value - unquoted literals might evaluate to the contents of a variable if that variable has been created. In this case (in 'the ... of ...'), though, the quoted literal gets treated as if it doesn't have quotes all the time.
>
> Warmest Regards,
>
> Mark.
>
> --
> Mark Waddingham ~ [hidden email] ~ http://www.livecode.com/
> LiveCode: Everyone can create apps


_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: how to get the value of a custom property if the name of the cProperty is in a variable?

** Clarence P Martin ** via use-livecode
In reply to this post by ** Clarence P Martin ** via use-livecode
On 2017-08-08 17:59, Mark Wieder via use-livecode wrote:
> On 08/08/2017 08:49 AM, hh via use-livecode wrote:
>>> JLG wrote:
>>> In what circumstance would it be necessary to quote the property
>>> name?
>>
>> Use "&" in a key, for example the "G&T" of me
>
> Is there any use case where punctuation in a property name is a good
> idea?

Is there any use case where punctuation in a variable name is a good
idea? ;)

As a custom property set is an unconstrained array; you can actually
have custom properties which have any string as key (set via the
customProperties property) - so it is entirely possible to create such
things. Whether you should or not is another matter, but that's true of
lots of things in LiveCode (and many programming languages in general).

The main issue here (I think) is the inconsistency in evaluation of
quoted literals - it means that you can't say

"A quoted literal always evaluates to the quoted value"

Instead you have to say:

"In all but the case of using the indirect form of setting a custom
property, a quoted literal will evaluate to the quoted value"

Having simple rules which are applicable in all cases both makes things
easier to learn, and harder to make mistakes (because you don't trip
yourself up on unique inconsistencies which you may have never known, or
have forgotten).

Warmest Regards,

Mark.

--
Mark Waddingham ~ [hidden email] ~ http://www.livecode.com/
LiveCode: Everyone can create apps

_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: how to get the value of a custom property if the name of the cProperty is in a variable?

** Clarence P Martin ** via use-livecode
In reply to this post by ** Clarence P Martin ** via use-livecode
On 08/08/2017 08:56 AM, Bob Sneidar via use-livecode wrote:
> Again, don't do that.
>
> Years ago I knew a woman who wanted to use special characters on her mac for file names which were perfectly legal with HFS, but NOT legal for NTFS. When we moved her files to a Windows share, some of her files, though visible, were inaccessible. (Why Windows even allowed the files to be written without some kind of warning is another mystery).

Heh.
Once on a Windows machine I ended up with a filename that had a trailing
space. Nothing would get rid of it. Nothing. Every disk utility I tried
found the file with no problem, but deleting the file failed because the
trailing space wasn't recognized by the OS. The File-That-Wouldn't-Die
lived on until the disk was reformatted.

--
  Mark Wieder
  [hidden email]

_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: how to get the value of a custom property if the name of the cProperty is in a variable?

** Clarence P Martin ** via use-livecode
In reply to this post by ** Clarence P Martin ** via use-livecode
On Tue, Aug 8, 2017 at 8:33 AM, Mark Waddingham via use-livecode <
[hidden email]> wrote:

> On 2017-08-08 17:25, J. Landman Gay via use-livecode wrote:
>
>> The answer to the first case is "don't do that". Use a different
>> variable name for the local.
>>
>
> Well, yes, that is certainly one way to look at it!
>

The catch is that this isn't something that I stumbled across while
initially developing.  It took a couple of years for things coming from two
different directions, each consistent in their own right, to collide like
this.

I see it as more of a maintenance issue than a development issue (but, then
that's where I was bit).

I'm also bothered by *not* being able to use a text literal in quotes; I'm
generally vary careful about declared variables, etc. (I'd really like an
option to enforce case in variable names!)

--
Dr. Richard E. Hawkins, Esq.
(702) 508-8462
_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: how to get the value of a custom property if the name of the cProperty is in a variable?

** Clarence P Martin ** via use-livecode
In reply to this post by ** Clarence P Martin ** via use-livecode
On Tue, Aug 8, 2017 at 8:56 AM, Bob Sneidar via use-livecode <
[hidden email]> wrote:

>
> Years ago I knew a woman who wanted to use special characters on her mac
> for file names which were perfectly legal with HFS, but NOT legal for NTFS.
> When we moved her files to a Windows share, some of her files, though
> visible, were inaccessible. (Why Windows even allowed the files to be
> written without some kind of warning is another mystery).
>

There is a long and tragic history of OSs allowing applications and calls
to create illegal file names . . .

My first (but not last) was discovering that CP/M would let MBASIC create a
file with a lower case name, even though CP/M was uppercase.  I want to say
that it displayed as uppercase in CP/M, too.  I think I ended up with two
files with the same name . . .

The *ONLY* punctuation I allow in file names are dot and underbar, and this
is enforced upon staff.   There aren't many others, if any, that have
meaning in *some* OS or another . . .
--
Dr. Richard E. Hawkins, Esq.
(702) 508-8462
_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: how to get the value of a custom property if the name of the cProperty is in a variable?

** Clarence P Martin ** via use-livecode
In reply to this post by ** Clarence P Martin ** via use-livecode
> Richard H. wrote:
> I'm also bothered by *not* being able to use a text literal in quotes;
> I'm generally vary careful about declared variables, etc. (I'd really
> like an option to enforce case in variable names!)

on mouseUp
  put "hello" into p1
  put quote&"hello"&quote into p2
  set the p1 of me to "new1"
  set the p2 of me to "new2"
  put the p1 of me && the p2 of me
end mouseUp

This works here as it should.
The keys become "hello" (incl.quotes) and hello (without quotes).

What do I not understand in your statement above?
What do you mean by "use a text literal in quotes"?

_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Loading...