Sign in to follow this  
Followers 0
iamsandeep

Please help with this concept

7 posts in this topic

#1 ·  Posted (edited)

$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

Share this post


Link to post
Share on other sites



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


- Bruce /*somdcomputerguy */  If you change the way you look at things, the things you look at change.

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

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

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

'Opt("ExpandVarStrings", 1)'?

Edited by omikron48

Share this post


Link to post
Share on other sites

'Opt("ExpandVarStrings", 1)'?

thnx a million omikron48 for u'r help.but it's still not working out.i thing the work around will be a huge switch case loop.but the code neither will be small nor smart.

Share this post


Link to post
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

Share this post


Link to post
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

Share this post


Link to post
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
Sign in to follow this  
Followers 0