Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
TreeView coding
Message
De
29/05/2002 08:34:11
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
TreeView coding
Divers
Thread ID:
00662378
Message ID:
00662378
Vues:
43
I have a table members1 which have Key,Parent,Name as belows:-
Key Parent Name
1_ 0_ Julie
2_ 1_ Bebe
3_ 2_ Lily
4_ 1_ Robert
5_ 2_ Liew



SELECT Members
o = THISFORM.memberlist.Nodes
o.Clear
SCAN
IF ALLTRIM(parent) = '0_'
o.add(,1,ALLTRIM(key),ALLTRIM(text),0)
ELSE
o.add(ALLTRIM(parent),4,ALLTRIM(key), ALLTRIM(text),0)

ENDIF
THISFORM.cNextKey = ALLTRIM(STR(VAL(key) + 1)+'_')
ENDSCAN
USE

This coding will list out all the member name and their childs, if I want to choose only lily to list out,all member under Lily will list as well. I try to code
cName=Thisform.cName.value
Select Members
If !seek(cName)
Return
Endif
cParent = Parent
Scan
If Alltrim(Parent) = cParent
o.add(,1,ALLTRIM(key),ALLTRIM(text),0)
ELSE
o.add(ALLTRIM(parent),4,ALLTRIM(key), ALLTRIM(text),0)

ENDIF
THISFORM.cNextKey = ALLTRIM(STR(VAL(key) + 1)+'_')
ENDSCAN
USE
Endif

It give an Error Message Invalid......


Any suggestions? Thanks
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform