Sign in to follow this  
Followers 0
PCode

Seeking data-structure suggestions

3 posts in this topic

#1 ·  Posted (edited)

Basically I want to sort data into a treeview. Ideally it would look something like this

Essay
-Paragraph 1
--Sentence 1
---Word 1
---Word 2
---Word 3
--Sentence 2
---Word 1
---Word 2
---Word 3
---Word 4
-Paragraph 2
...

I think that should give you the picture. The number of paragraphs in an essay, sentences in a paragraph, and words in a sentence however are unknown.

One thing I've considered is a multidimensional array, but wouldn't I have to have every sentence store the same amount of words as the sentence with the highest amount of words?

I've also considered arrays of arrays, but wouldn't I have a create a dummy array every time I wanted to go a dimension further into the array?

So either correct me if I'm mistaken, suggest a better way of storing this data, or tell me that I'm just between a rock and a hard space.

Edited by PCode

Share this post


Link to post
Share on other sites



Sounds like an XML file would do nicely. Have you any experience with _XMLDOMWrapper.au3 UDF or XPath syntax?

:mellow:


Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law

Share this post


Link to post
Share on other sites

I once used this code to populate a Treeview.

Every line starts with a #. The number of spaces denote the level in the tree. No space = top level, 1 space = child of top level etc.


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2017-04-18 - Version 1.4.8.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-27 - Version 1.3.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0