[jawsscripts] Help required in a function for optional parameters.

  • From: "jitender kumar@5142695" <Jeet.Kumar1@xxxxxxxxx>
  • To: "jawsscripts@xxxxxxxxxxxxx" <jawsscripts@xxxxxxxxxxxxx>
  • Date: Fri, 23 Feb 2018 07:51:09 +0000

Hello friends, the following line is producing the error as:
"Compile Error
 Error: Parameter 2 to Function fsxml__GetElementByIndex  should
be of type string not int
OK "
Even though I have created the optional parameters.
sayString (fsxml__GetElementByIndex ( "ToolBar", 
1).attributes.GetNamedItem("fsText").nodeValue)
;This works fine.
;sayString (fsxml__GetElementByIndex ( "ToolBar", 
"",1).attributes.GetNamedItem("fsText").nodeValue)
Globals
Int Elements_length
Object Function fsxml__GetElementByIndex ( Optional string Tag, Optional string 
Attributes, Optional int Index)
;This gets all or a single element matching the tag or window type as an object.

var

object doc = fsxml__virtualCursorContext(-3),;A function from a module, gets 
the xml document.
Object Tags_List
if !doc
sayString("noDoc")
    return
endIf
If !Tag then
Tag = "ToolBar"
EndIf
Tags_List = doc.SelectNodes("//"+Tag)
Elements_length = Tags_list.length
;SayInteger (Elements_length );Debug
If Index == -1 then
Return Tags_List
Else
Return  Tags_List.item(index)
EndIf
EndFunction
--- Disclaimer ---
The information in this mail is confidential and is intended solely for 
addressee. Access to this mail by anyone else is unauthorized. Copying or 
further distribution beyond the original recipient may be unlawful. Any opinion 
expressed in this mail is that of sender and does not necessarily reflect that 
of State Bank group.
---

__________�

View the list's information and change your settings at 
http://www.freelists.org/list/jawsscripts

Other related posts:

  • » [jawsscripts] Help required in a function for optional parameters. - jitender kumar@5142695