News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

List?

Started by axmt, June 22, 2006, 05:15:38 AM

Previous topic - Next topic

axmt

Hi,
I want to dynamically populate a list of strings.
How do I go about doing it?
I want to do the following -
1. Create a List like structure whose size will be dynamic
2. Add custom structs to this list and traverse it forward and backward

Thanks,
axmt.

gwapo

Generally these are implemented as a LinkedList or HashTable., I don't know of any assembly implementation though, probably there's one in MASM32.

\
-chris

hutch--

It sounds like a database design that has variable length fields in it. tell us a bit more about how you want to use it but it sounds like an algo design rather than just coding something.
Download site for MASM32      New MASM Forum
https://masm32.com          https://masm32.com/board/index.php

axmt

Hi,
I am trying to make a vocabulary builder utility.
So I have words and their meaning stored in a text file.
I read the File during initialization and want to store each word - meaning pair in an 'Entry' struct.
These structs will be added to the list.The number of entries will depend on number of pairs in text file hence the list size should be dynamic.
In the UI there will be a back and forward button to traverse through the list.

I am coming from a C,C++,Java background, there are List abstractions available in the libraries which are useful in a number
of scenarios.
So I am trying to figure out how to design a similar functionality in win32asm.

Thanks,
axmt

asmfan

Just create an appropriate dynamic queue of structs. Each struct contain one or more pointers on neighbours and data itself of course. And may be some other info...hash or CRC...
Russia is a weird place

zooba

A while ago I created a generalised linked list implementation. In reality, it's a linked array list, in that each item is a fixed size array of the items, cutting down on fragmentation and allocation times.

I've attached the source, compiled library (LinkedList.lib) and a sample/test program (Tester.asm). Feel free to modify it for your own use, but it should be general enough to easily do what you want.

Cheers,

Zooba :U

[attachment deleted by admin]

axmt

Thanks zooba  :U
Am checking it out.
Thanks for your help guys  :8)