Donate Now Goal amount for this month: 100 USD, Received: 0 USD (0%)
Donate to support this site and ThinBASIC project development

Results 1 to 2 of 2

Thread: Error with Dictionary_MemInfo

  1. #1
    Member REDEBOLT's Avatar
    Join Date
    Dec 2006
    Location
    Pickerington, Ohio, USA
    Age
    78
    Posts
    62
    Rep Power
    15

    Error with Dictionary_MemInfo

    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

  2. #2
    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

Similar Threads

  1. Little error
    By Petr Schreiber in forum Fixed or cleared errors in help material
    Replies: 3
    Last Post: 22-02-2006, 10:59

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •