[jawsscripts] Re: Input Box

  • From: Bob <temp@xxxxxxxxxxxxxxx>
  • To: jawsscripts@xxxxxxxxxxxxx
  • Date: Fri, 06 Jun 2014 12:01:37 +0100

This wont compile
InputBox returns an Int indicating if the OK or Cancel button was pressed.
You dont have to assign this to a variable if you dont need the value.
InputBox ("name of book", "What is the name of the book?", sName)
Is fine as is
let iButtonPressed = InputBox ("name of book", "What is the name of the 
book?", sName)

You also dont have to initialize the variable to an empty string as this 
happens when you declare it in the Var statement.

Script save ()
var
string sName, Int iButtonPressed

let sName = "" ;initializes variable to empty string
let iButtonPressed = InputBox ("name of book", "What is the name of the 
book?", sName)
delay (3)
TypeString (sName)

EndScript

Bob

On 04/06/2014 20:20, Jackie McBride wrote:
> Dale, first, your code is a bit backward, & 2nd, as Travis points out,
> you're not saving the result to a variable. Here's how the code should
> look. Can u tell me why?
>
> Script save ()
>
> var
> string sName
>
> let sName = "" ;initializes variable to empty string
> let sName= InputBox ("name of book", "What is the name of the book?", sName)
> delay (3)
> TypeString (sName)
>
> EndScript
>
>
> On 6/4/14, Travis Roth <travis@xxxxxxxxxxxxxx> wrote:
>> You are not saving the result of inputbox to a variable.
>>
>>
>> -----Original Message-----
>> From: jawsscripts-bounce@xxxxxxxxxxxxx
>> [mailto:jawsscripts-bounce@xxxxxxxxxxxxx] On Behalf Of Dale Alton
>> Sent: Wednesday, June 04, 2014 1:13 PM
>> To: jawsscripts@xxxxxxxxxxxxx
>> Subject: [jawsscripts] Input Box
>>
>> Hello all,
>>
>>
>> I am a fairly inexperienced scriptor and am having difficulties with the
>> InputBox function.  I thought I had this down but it isn't working for me.
>> What have I done incorrectly?
>>
>> Script save ()
>>
>> var
>>
>> string sName
>>
>> InputBox ("name of book", "What is the name of the book?", "")
>>
>> let sName = ""
>>
>> delay (3)
>>
>> TypeString (sName)
>>
>>
>>
>> EndScript
>>
>> Thank you,
>>
>> Denver Dale
>>
>>
>>
>> __________�
>>
>> 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
>>
>>
>

__________�

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

Other related posts: