[jawsscripts] Using an counter variable in an If Loop
- From: "Logan McMullen" <loganmcmullen@xxxxxxxxxxxxxxx>
- To: "Jaws Scripting List" <jawsscripts@xxxxxxxxxxxxx>
- Date: Tue, 30 Jun 2009 18:19:22 +1200
Hi,
I'm creating a script which has a nested If statement.
When the script fires it offers the user an input box ..the inputted string
becomes a stored variable that then actions other user defined functions or
moves to a location on the current page.
This input box will be used by the person to get to a number of locations...so
may be used a number of times within the same window/session.
The locations on the same page are dynamic fields that I have identified and
have got the required cursor moving to...however once one of these fields has
been clicked on and activated the mouse must be clicked out of the dynamic area
before being moved to another of these fields.
My solution has been to create an int variable that acts as a counter for the
script; the script can check if it has been actioned before by looking at the
counter value and if it hasn't it can move directly to one of the dynamic
fields..but if the value is not nul or 0 it would then perform the click out of
the area action before going on with the move to command.
My question is:
How do I make the Int counter work so that I can use it as a variable to check ?
The first If statement of my script currently reads like this:
var
String sFindThis,
Int iCount
; String is the variable to search on from the input box
; Int is a counter for the If Statement
InputBox ("Where To?: ", "Navigation Box", sFindThis )
; Displays a dialogue box for user to enter a location
; Can be actioned in any of the areas worked in if required
If sFindThis = "Coy" && iCount = 0 Then
MoveTo (683, 387)
LeftMouse ()
; Moves to and clicks on the Coy No field
Let iCount =1
; Makes the counter 1
Will this statement work if it is followed by an ElIf statement such as:
If sFindThis = "Coy" && iCount =! 0 Then
MoveTo (1, 1)
LeftMouse ()
;moves away from the dynamic area and performs a left click
Pause ()
MoveTo (683, 387)
LeftMouse ()
; Moves to and clicks on the Coy No field
There are a number of these fields that the user might want to activate one
after another so if this won't work, does anyone have any ideas?
Cheers
Logan
__________
Visit and contribute to The JAWS Script Repository http://jawsscripts.com
View the list's information and change your settings at
http://www.freelists.org/list/jawsscripts
Other related posts: