PDA

View Full Version : Error with Dictionary_MemInfo



REDEBOLT
03-09-2011, 08:54
Hi,

When I run the following code, I get an error screen:


' Empty GUI script created on 09-03-2011 01:38:16 by Robert E. DeBolt (ThinAIR)
Uses "dictionary", "console"

Dim pDict As Long '---Pointer to dictionary
Dim counter As Long
Dim nInfo As Number

pDict = Dictionary_Create(1000000, %TRUE)

For counter = 1 To 100000
Dictionary_Add(pDict, counter, String$(100, Counter))
Next

'MsgBox 0, "Add OK"

PrintL "Data key = 1000 is: " & LEFT$(Dictionary_Find(pDict, 62),10) & " ..."

'MsgBox 0, "Data key = 1000 is: " & LEFT$(Dictionary_Find(pDict, 62),10) & " ..."
nInfo = Dictionary_MemInfo(pDict, %HT_MemInfo_Keys)
PrintL "%HT_MemInfo_Total = " + nInfo
Dictionary_Free(pDict)
WaitKey


Regards,
Bob

zak
03-09-2011, 10:13
use %DICTIONARY_MEMINFO_KEYS since there is no %HT_MemInfo_Keys listed in file thinBasic_Keywords in folder C:\thinBasic\thinAir\Syntax\thinBasic
i see there is also %DICTIONARY_MEMINFO_TOTAL
%DICTIONARY_SORTDESCENDING