Proceeding to convert a Gambas1 app to Gambas2, I found that reading key
values or stepping through the values is different now.

The TreeView shows names of persons sorted under groups/classes/filters
sorted under years sorted under a root header, in brief:

Root1
        2004
        2005
        2006
                Group1
                Group2 <-- Cursor
                        John
                        Benoit
                        Michael
                        Rolf
                Group3
        2007
        2008
Root2

What I want is when the cursor is on Group2 and I call my function, it
expands and reads all keys of the names within this group.

This is the code in Gambas1:

      baum.Current.Expanded = TRUE

      namenKeys.Clear

      FOR i = 1 TO baum.Current.Children
        baum.Item.MoveBelow
        IF Left$(baum.Item.Key, 1) = "#" THEN
          namenKeys.Add(baum.Item.Key)
        ELSE
          BREAK
        END IF
      NEXT

"baum" is the TreeView, "namenKeys" is an array that should return the
keys which were found. The idea was to read the keys either up to the
number of children or until the next key doesn't have a "#".

This doesn't run in Gambas2 this way, but I didn't find a way to make it
run. MoveBelow doesn't seem to exist anymore (Gambas2 won't show an
error, however), and I tried any possible combination of using
MoveAfter() with Item and Current, but to no avail.

So, can anybody help here?

Thanks so much!

Rolf



------------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It is the best place to buy or sell services for
just about anything Open Source.
http://p.sf.net/sfu/Xq1LFB
_______________________________________________
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user

Reply via email to