Re: case sensitivity of the keys in an associative array

2022-08-23 Thread francois.chaplais via use-livecode
Thanks to you all!

This list is a treasury.

Chers,
François

> Le 23 août 2022 à 16:46, Klaus major-k via use-livecode 
>  a écrit :
> 
> Bonjour François,
> 
>> Am 23.08.2022 um 16:31 schrieb francois.chaplais via use-livecode 
>> :
>> 
>> Dear list
>> 
>> From my current work on a LiveCode project, it seems that the keys of an 
>> associative array are not case sensitive.
>> 
>> For instance, I may define 
>> theArray[« Ddt »]
>> 
>> If I define now  
>> theArray[« ddt »]
>> 
>> this entry replaces the previous one (forgive apple mail which replaces my 
>> double quotes by french double quotes)
>> 
>> Is this behavior confirmed?
> 
> yes, taht is correct bahvior!
> 
> But you can force case sensitivity in LC:
> ...
> set the casesensitive to TRUE
> answer theArray[« Ddt »]
> ## -> NADA!
> 
> answer theArray[« ddt »]
> ## Will do what you want.
> ...
> 
>> Best regards
>> François
> 
> Best
> 
> Klaus
> 
> --
> Klaus Major
> https://www.major-k.de
> https://www.major-k.de/bass
> kl...@major-k.de
> 
> 
> ___
> use-livecode mailing list
> use-livecode@lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription 
> preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode


___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: case sensitivity of the keys in an associative array

2022-08-23 Thread Klaus major-k via use-livecode
Bonjour François,

> Am 23.08.2022 um 16:31 schrieb francois.chaplais via use-livecode 
> :
> 
> Dear list
> 
> From my current work on a LiveCode project, it seems that the keys of an 
> associative array are not case sensitive.
> 
> For instance, I may define 
> theArray[« Ddt »]
> 
> If I define now  
> theArray[« ddt »]
> 
> this entry replaces the previous one (forgive apple mail which replaces my 
> double quotes by french double quotes)
> 
> Is this behavior confirmed?

yes, taht is correct bahvior!

But you can force case sensitivity in LC:
...
set the casesensitive to TRUE
answer theArray[« Ddt »]
## -> NADA!

answer theArray[« ddt »]
## Will do what you want.
...

> Best regards
> François

Best

Klaus

--
Klaus Major
https://www.major-k.de
https://www.major-k.de/bass
kl...@major-k.de


___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: case sensitivity of the keys in an associative array

2022-08-23 Thread Alex Tweedly via use-livecode

Not quite.

It is dependent on the value of "casesensitive".

If you do

set the casesensitve to true

then the keys are different (i.e. Ddt  would NOT replace the existing 
value for ddt)


but if it is false (which it would be by default) thne DDt and ddt are 
teh same.


[Only tested on 10.0.0 DP4 - but I think that's how it's always been]

Alex.


on mouseup
   local tA
   put 1 into tA["a"]
   put "1" && the keys of tA  after msg
   set the casesensitive to true
   put 2 into tA["A"]
   put "2" && tA["a"] && the keys of tA  after msg
end mouseup


On 23/08/2022 15:31, francois.chaplais via use-livecode wrote:

Dear list

 From my current work on a LiveCode project, it seems that the keys of an 
associative array are not case sensitive.

For instance, I may define
theArray[« Ddt »]

If I define now
theArray[« ddt »]

this entry replaces the previous one (forgive apple mail which replaces my 
double quotes by french double quotes)

Is this behavior confirmed?

Best regards
François
___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode