Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Does not equate to an object
Message
From
29/12/1998 15:34:51
 
 
To
29/12/1998 15:13:51
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00171318
Message ID:
00171327
Views:
33
Hi Mike ---

Could test Nodes.Count before executing the code?

>Am I losing my mind? I use the following code to change the default behavior of the Treeview control to get the behavior the designers want when a child is removed from a tree:
>
>* BEGIN FRMTREEVIEW.GETNODETOSELECT()
>* Description: A valid node associated with the Tree to be manipulated.
>* Parameters: -
>* Returns:
>* Notes: 1.
>* 2.
>* Revisions: 12/16/1998 - MWT
>* - Created
>lParameters toNode
>
>if (VarType(toNode.next) == "O")
> if (NOT isNull(toNode.next))
> if (VarType(toNode.next.Selected) == "L")
> toNode.Next.Selected = .T.
> Wait clear
> return
> endif
> endif
>endif
>
>if (VarType(toNode.Previous) == "O")
> if (NOT isNull(toNode.Previous))
> if (VarType(toNode.Previous.Selected) == "L")
> toNode.Previous.Selected = .T.
> Wait clear
> return
> endif
> endif
>endif
>
>if (VarType(toNode.parent) == "O")
> if (NOT isNull(toNode.parent))
> if (VarType(toNode.Parent.Selected) == "L")
> toNode.Parent.Selected = .T.
> endif
> endif
>endif
>
>* END FRMTREEVIEW.GETNODETOSELECT()
>
>
>This code is called before a node is removed from a tree. After deleting some number of nodes from a tree (from 2 - 27 in testing), any of the instructions toNode.????.Selected = .T. generates a
>
>"Member ????? does not equate to an object." What other tests of a node can I make? The default behavior of deleting the last child on a node is to select the Parent node, instead of our desired previous node.
>
>Any assistance would be GREATLY APPRECIATED.
>
>Mike
------------------------------------------------
John Koziol, ex-MVP, ex-MS, ex-FoxTeam. Just call me "X"
"When the going gets weird, the weird turn pro" - Hunter Thompson (Gonzo) RIP 2/19/05
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform