Jump to content

Please help with this concept


Recommended Posts

$i=0

$a1="Checking complete."

$a2="blah blah"

While $i<1

$j = InputBox("Text", "1.press 1 for checking complete.2.press 2 for ...blah blah", "")

$oSp = ObjCreate("SAPI.SpVoice")

$c="$a" & $j

;MsgBox(1,"",$c)

$oSp.Speak($c)

WEnd

sapi is speaking "$a" which is the value inside $c but i need the value inside $a in that place.

please help.thank you.

Edited by iamsandeep
Link to comment
Share on other sites

The variable $a isn't declared or given a value. "$a" is a string.

Nice observation.and somewhat there my problem goes.i need that string value sitting inside $a1 in the $oSp.Speak($c) line.is there any way to get the value of the value of $c because that's what i need. Edited by iamsandeep
Link to comment
Share on other sites

$i=0

$a[2] = ["Checking complete.", "blah blah"]

While $i<1

$j = InputBox("Text", "1.press 1 for checking complete.2.press 2 for ...blah blah", "")

$oSp = ObjCreate("SAPI.SpVoice")

$c=$a[$j]

;MsgBox(1,"",$c)

$oSp.Speak($c)

WEnd

[font=Microsoft Sans Serif]My Scripts: From Most recent to least.[/font]Countdown GUI | QLOCK TWO | FlipClock | Slot Machine My UDF:_GenerateRandomNoRepeat | _GuiSnap

Link to comment
Share on other sites

Or, maybe:

$oSp = ObjCreate("SAPI.SpVoice")
$a1 = "Checking complete."
$a2 = "blah blah"
While 1
    $j = InputBox("Text", "Enter 1 for complete, 2 for 'blah blah', E for exit")
    Switch $j
        Case "1"
            $sText = $a1
        Case "2"
            $sText = $a2
        Case "E"
            $sText = "Goodbye."
        Case Else
            $sText = "Try again, bone head!"
    EndSwitch
    $oSp.Speak($sText)
    If $sText = "Goodbye." Then ExitLoop
WEnd
$oSp = 0

:)

Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...