Anton_A
14 years agoOccasional Contributor
Doesn't return anything from catch block
Hi,
Could someone pls see my function on JScript. I am looking for particular node in infragistic tree and want to handle case when there is no such node inside.
function SelectNode(treeObj, soughtNode) {
var node = FindNode(treeObj, soughtNode); //if sought value is not found i expect here stub object, but it is undefined actually
if (node.Exists)
node.set_Selected(true);
}
function FindNode(treeObj, soughtNode) {
try {
for (var i = 0; i < treeObj.Nodes.Count; i++) {
var node = treeObj.Nodes.Item(i);
if(SameText(soughtNode, node.Text.OleValue)) {
return node;
}
}
FindNode(node, soughtNode);
} catch(error) {
Log.Warning(error.name,error.description);
return Utils.CreateStubObject();
}
}
Could someone pls see my function on JScript. I am looking for particular node in infragistic tree and want to handle case when there is no such node inside.
function SelectNode(treeObj, soughtNode) {
var node = FindNode(treeObj, soughtNode); //if sought value is not found i expect here stub object, but it is undefined actually
if (node.Exists)
node.set_Selected(true);
}
function FindNode(treeObj, soughtNode) {
try {
for (var i = 0; i < treeObj.Nodes.Count; i++) {
var node = treeObj.Nodes.Item(i);
if(SameText(soughtNode, node.Text.OleValue)) {
return node;
}
}
FindNode(node, soughtNode);
} catch(error) {
Log.Warning(error.name,error.description);
return Utils.CreateStubObject();
}
}