[Gambas-user] Collection key

tobias tobiasboe1 at ...20...
Wed Oct 12 19:16:52 CEST 2011


On 12.10.2011 19:05, John Spikowski wrote:
> On Wed, 2011-10-12 at 19:43 +0300, Jussi Lahtinen wrote:
>> My first thought too... and I wonder why there is limit anyway..?
>> I have understand that collection works with hash values, and at least there
>> are no practical limitations with MD5 hash function.
>>
>> Jussi
> For grins, I thought I would test the hash key length in ScriptBasic to
> see if this was a common problem. I don't think there is a practical
> limit to the key size in ScriptBasic.
>
> IMPORT hash.bas
>
> h = hash::New()
> hash::SetValue(h,"A1234567890",1)
> hash::SetValue(h,"B12345678901234567890",2)
> hash::SetValue(h,"C123456789012345678901234567890",3)
> hash::Start(h)
>
> FOR x = 1 to 3
>    PRINT hash::ThisKey(h), " - "
>    PRINT hash::ThisValue(h),"\n"
>    hash::Next(h)
> NEXT
>
> jrs at ...1833...:~/sb/test$ scriba testhash.sb
> A1234567890 - 1
> B12345678901234567890 - 2
> C123456789012345678901234567890 - 3
> jrs at ...1833...:~/sb/test$

i tested the limitation, too, in gb3 but it ran o.k.
how may the exceeding of the key length influence the program integrity?




More information about the User mailing list