sheekha
asked on
Vbscript runtime error 800a005e
Function GetNumberKids(myNode,myArr ay)
Dim myTemp
myTemp=""
myCount = 0
Dim i
'Look for kids
for i = lbound(myArray,2) to ubound(myArray,2)
if cstr(myArray(1,i))=cstr(my Node) then ' we found a kid
if myTemp="" then
myTemp= cstr(myArray(0,i))
else
myTemp= myTemp & "," & cstr(myArray(0,i))
End if
myCount=myCount+1
End if
Next 'i
GetNumberKids = myTemp
End Function
Dim myTemp
myTemp=""
myCount = 0
Dim i
'Look for kids
for i = lbound(myArray,2) to ubound(myArray,2)
if cstr(myArray(1,i))=cstr(my
if myTemp="" then
myTemp= cstr(myArray(0,i))
else
myTemp= myTemp & "," & cstr(myArray(0,i))
End if
myCount=myCount+1
End if
Next 'i
GetNumberKids = myTemp
End Function
ASKER
if cstr(myArray(1,i))=cstr(my Node) then error of this line cstr invalid
check the values of myArray(1,i) and myNode - one or both of them is probably null. you can check for null with
If isnull(myNode)
which will return true if myNode is null
If isnull(myNode)
which will return true if myNode is null
ASKER
Thanks. can you explain all the code?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
This question has been classified as abandoned and is closed as part of the Cleanup Program. See the recommendation for more details.
have you tried putting a break on the mytemp="" line then stepping through the code and checking the variable contents at the point where it fails?