7 thoughts on “Hash and Stack in VBA

  1. Maybe there are arguments in favor of stacks as a data type, but there’s no clear point I can see to a limited hash table type vs either generic VBA Collection objects or WSH Dictionary objects. Not the point of late/lazy population of such a table, just the pointlessness of reinventing the data structure.

  2. fzz wrote:
    Maybe there are arguments in favor of stacks as a data type, but there’s no clear point I can see to a limited hash table type vs either generic VBA Collection objects or WSH Dictionary objects. Not the point of late/lazy population of such a table, just the pointlessness of reinventing the data structure.

    Looking at the code in the links, it does appear to be a reinvention of the wheel, without the advantages of “modern tires” like the Collection object. Interesting that you mention the Dictionary object. I tend to use it more often than the Collection object. Come to think of it, I can’t recall any discussion of the Dictionary object in VBA circles, in spite of its many advantages over the Collection object.

  3. Doug,

    Thanks for the heads-up. I completely overlooked Chip’s discussion on this topic.

  4. Dictionnary are definitely a good weapon when it comes to VBA,

    I built an entire translation tool using dictionnary, and its actually running faster than the same program done in delphi (command line only and optimized). I was able to translate a 75 000 lines text file with each line being between 2000 and 3000 lines in less than 5 sec…
    (open file send each line into an array using split, then replace each cell of the array by the corresponding entry in the dictionnary and write the line back to the new file)
    and the dictionnary was about 1200 entries


Posting code? Use <pre> tags for VBA and <code> tags for inline.

Leave a Reply

Your email address will not be published.