You're right!! I did it with only an "echo" loading (?sys(2015)), and no duplicates. A year or two ago with VFP 7 I was gettin duplicates when adding objects to a container. Is it new since 8 - or is the loading less when adding to a treeview?
Thanks
Boris,
I spoke too soon!:-)
>In a tight loop with no code but generating a call to SYS(2015) and adding a record to a cursor (000's per second), I see no dups.
>
>>I think I tried it and if your cycle is faster than 1/100 or 1/1000 of a second, it duplicates. Which may be good in a way - it could "force" us to use keys associated with records in a table.
>>
>>>SYS(2015) should always be unique. SYS(3) had the problem with calling it too quickly.
>>>
>>>>Welcome back :o)
>>>>
>>>>Yes, The loop can be too fast, but this is an example HOW to add a node. I suppose nobody using SYS(2015) as a Key, because when use click on Node how S/He can do something with the record matching that node?
>>>>
>>>>>Sometimes the loop may be too fast for a SYS(2015) to generate a unique key.
>>>>>
>>>>>>>Treeview - trying to display contents from a dbf
>>>>>>Nothing easier :o)
>>>>>>But can you post the structure of the DBF and how you want the treeview looks like?
>>>>>>Most simple way:
>>>>>>
>>>>>>thisform.oleTree.Nodes.Add(,1,"RootDBFNode","YourDBF Name",,)
>>>>>>SELECT YourDbf
>>>>>>SCAN
>>>>>> oNode = thisform.oleTree.nodes.add("RootDBFNode",4,SYS(2015), ALLTRIM(Name),,)
>>>>>>ENDSCAN
>>>>>>
Imagination is more important than knowledge