[Gambas-user] Collection key

John Spikowski support at ...2529...
Wed Oct 12 19:05:30 CEST 2011


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$ 







More information about the User mailing list