iamsandeep Posted October 6, 2009 Share Posted October 6, 2009 (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 October 6, 2009 by iamsandeep Link to comment Share on other sites More sharing options...
somdcomputerguy Posted October 6, 2009 Share Posted October 6, 2009 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. Link to comment Share on other sites More sharing options...
iamsandeep Posted October 6, 2009 Author Share Posted October 6, 2009 (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 October 6, 2009 by iamsandeep Link to comment Share on other sites More sharing options...
omikron48 Posted October 6, 2009 Share Posted October 6, 2009 (edited) 'Opt("ExpandVarStrings", 1)'? Edited October 6, 2009 by omikron48 Link to comment Share on other sites More sharing options...
iamsandeep Posted October 6, 2009 Author Share Posted October 6, 2009 '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. Link to comment Share on other sites More sharing options...
billthecreator Posted October 6, 2009 Share Posted October 6, 2009 $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 More sharing options...
PsaltyDS Posted October 6, 2009 Share Posted October 6, 2009 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 More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now