[jawsscripts] Re: Require help in a script to get out of while loop

  • From: Jitendra Kumar <jeet.invincible@xxxxxxxxx>
  • To: jawsscripts@xxxxxxxxxxxxx
  • Date: Fri, 29 Dec 2017 18:06:17 +0530

Thank you, I did not by now, shall try and let you know.

On 12/29/17, Bob <temp@xxxxxxxxxxxxxxx> wrote:

Not sure if you figured this out yet but Jackie's response regarding
checking the keypressed event is unnecessary and I didn’t want you to waste
too much time looking at that.

You want to loop only while the enter key is pressed / OK button on the
dialog and the input has been completed.
The Input box returns and integer based on the button that is pressed. 0 for
the cancel button.
So...

Title = ""
While InputBox ("The account holder's  name:", "Add Account", Title) &&
StringIsBlank (Title)
      ;This will loop until you press escape or complete the field.
      ;This line is just in case the Title variable is updated even when you
cancel. You may not need it but I can't test for it right now
      Title = ""
EndWhile
;Now you are here you still need to check that we didn’t press escape.
If StringIsBlank (Title)
      ;Quit the script if not complete
      Return
EndIf
;Continue your processing here

Shout if I can help any more.

Bob

-----Original Message-----
From: jawsscripts-bounce@xxxxxxxxxxxxx
[mailto:jawsscripts-bounce@xxxxxxxxxxxxx] On Behalf Of Jitendra Kumar
Sent: 25 December 2017 02:21
To: jawsscripts@xxxxxxxxxxxxx
Subject: [jawsscripts] Re: Require help in a script to get out of while
loop

I want if ESC is pressed or cancel button is clicked (by enter or space), it
should close the dialog, but if OK is pressed, it should come up again to
ask for the information.

On 12/24/17, Jackie McBride <abletec@xxxxxxxxx> wrote:
Jitendra, you're defeating your purpose, ie, Let I = InputBox ("the
account holder's  name", "Add account", title) If I then While
StringIsBlank (Title)

So what you're basically saying here is that if i exists (which it
does because you've created the input box) & i is blank, keep bringing
up the dialog box. So u might wish to do some key pressed events or
message monitoring so that when the esc key is pressed, the dialog is
cancelled.

HTH.

On 12/23/17, Jitendra Kumar <jeet.invincible@xxxxxxxxx> wrote:
Hello friends, below is a script given, if I press cancel from the
JAWS dialog without typing anything, it is OK, but if I press OK, the
dialog is recreated, this is what I want, but I should be able to
cancel the dialog, which is not happening if I press OK with an empty
edit box.
Script AddAcount ()
;For adding the account number and the name.
;First edit box is for the name, second for the number.
;use this script to add accounts, then only you get them using the
ShowAccounts script.
;For testing, we attached Alt+Grawv.
Var
String title,
string text,
int I,
int i2
Let I = InputBox ("the account holder's  name", "Add account", title)
If I then While StringIsBlank (Title) Say ("No name has been
specified, please try again", 13 ) Let I = InputBox ("the account
holder's  name", "Add account", title) Endwhile Let I2 = InputBox
("the account number", "Add account", text) Else SayMessage (13, "no
Holder's name has been specified", "no message has been specified")
Return Endif If I2 then While StringIsBlank (text) Say ("Name can not
be saved without an account number, please try again",
13
)
;the dialog should be recreated only if user presses OK without
typing in it.
Let I2 = InputBox ("the account number", "Add account", text)
Endwhile IniWriteString ("accounts", title, text, "acs.ini", 1)
SayMessage (13, "the entry against, "+title+" "+text+"has been
added.",""
)
Else
SayMessage (13, "no message has been specified", "no message has been
specified")
Return
EndIf
EndScript
__________

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




--
Remember! Friends Help Friends Be Cybersafe Jackie McBride Helping
Cybercrime Victims 1 Person at a Time https://brighter-vision.com
__________

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




--
Skype:
Jeet.delhi
__________

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



__________�

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




-- 
Skype:
Jeet.delhi
__________�

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

Other related posts: