Sign in to follow this  
Followers 0
dazza

Populating a TreeView from a file

7 posts in this topic

A file has this structure: (for example - and I know my footy knowledge is erroneous)

ARSENAL#KEEPER#FRENCH#saving94#ALMUNIA

ARSENAL#DEFENDER#FRENCH#tackling98#TOURE

ARSENAL#DEFENDER#FRENCH#tackling98#EBOUE

ARSENAL#DEFENDER#FRENCH#tackling94#CLICHY

ARSENAL#MIDFIELD#SPANISH#passing90#FABREGAS

ARSENAL#MIDFIELD#ENGLISH#shooting56#BENTNER

MAN UTD#KEEPER#DUTCH#saving98#VAN DER SAAR

MAN UTD#DEFENDER#ENGLISH#Tackling78#O'SHEA

MAN UTD#FORWARD#ARGENTINIAN#shooting87#TEVEZ

I can split it by line and element, but how do I get this data in a treeview? (with $TVS_HASBUTTONS)

And what is the msg$ (from GUIGetMsg) to check which buttons have been pressed?

Many thanks.

Share this post


Link to post
Share on other sites



Share this post


Link to post
Share on other sites

That depends how you want to display it in a treeview. Create a sample script, that shows output and we can see what we can do...

Cheers,

Brett

Urr. Standard

+Arsenal <click on this to open it

+Man Utd

-Arsenal

+ KEEPER

+ DEFENDER <click on this to open it

+ MIDFIELD

+Man Utd

-Arsenal

+ KEEPER

- DEFENDER

+ FRENCH

+ SPANISH

+ ENGLISH

+ MIDFIELD

+ Man Utd

I hope this suffices. Anything close to this format will do; I should be able to alter it once it's made.

Share this post


Link to post
Share on other sites

$each_line = StringSplit($data_file, chr(13))

For $f = 1 to $each_line[0]                                                ;eg ARSENAL#KEEPER#FRENCH#saving94#ALMUNIA

    $datum = StringSplit($each_line[$f], "#")                         ; so $datum[1]="ARSENAL", [2]="KEEPER", [3]="FRENCH", [4]="saving94", [5]="ALMUNIA"

  ;now comes the bit I cannot do
  ;PUT ELEMENTS INTO A TREE VIEW

Next

Share this post


Link to post
Share on other sites

Figured out, done and dusted.

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