|
|
#1 |
|
New Member
Join Date: Mar 06
Posts: 2
![]() |
dear all.. my name is Kwei from malaysia m currently doing my final year honors project which is a smart voice enabled english learning tool for visual impaired kids.. using vb.net with microsoft agent to spice up the smartness of the system, i have a problem that i m not able to figure out...my desired output is to make the agent n the loop structure run the whole tutorial without user pressing any keypress to go to the next question. i had tried enabling n disabling the textbox but things just dun go rite... need help or advice my viva is coming real soon below are my code portion for the problem with comments of deisred output n problem faced.
[highlight=VB]/*on keypress ENTER key it is suppose to run on its on just like an automation turotrial Case "SPACE" mSpk2.Stop() mSpk2.Speak("Here we go!!!!!") Do Until loop_random = 10 generated_random_number = RandomNumber.Next(1, 26) If RandomNumber.Next(1, 26) = 1 Then mSpk2.Stop() mSpk2.Speak("A is for?") If strKeyPress.ToUpper() = "ENTER" And TextBox1.Text = "APPLE" Then/* when compiler reaches here it will straight go to the else result without even lettin me to input text into the textbox..i think this is where the real problem lies..hope anyone at all could give a hand or advice..it will be most appreciated" mSpk2.Stop() mSpk2.Speak("Bravo! A is for Apple.") mSpk2.Speak("A,P,P,L,E Apple.") loop_random = loop_random + 1 Else mSpk2.Speak("Oops!! You are wrong!!!") mSpk2.Speak("A is for Apple.") mSpk2.Speak("A,P,P,L,E Apple.") mSpk2.Speak("Next Question is ") loop_random = loop_random + 1 End If ElseIf RandomNumber.Next(1, 26) = 2 Then mSpk2.Stop() mSpk2.Speak("B is for?") If strKeyPress.ToUpper() = "ENTER" And TextBox1.Text = "BALL" Then mSpk2.Stop() mSpk2.Speak("Bravo! B is for Ball.") mSpk2.Speak("B,A,L,L Ball.") loop_random = loop_random + 1 Else mSpk2.Speak("Oops!! You are wrong!!!") mSpk2.Speak("B is for Ball.") mSpk2.Speak("B,A,L,L Ball.") mSpk2.Speak("Next Question is ") loop_random = loop_random + 1 End If |
|
|
|
|
|
#2 |
|
Banned
Join Date: Nov 05
Posts: 2,367
![]() ![]() ![]() ![]() |
Re: trying to manipulate an automation process
Welcome to VBF
![]() Unfortunately, there's alot of important information that your code isn't telling us. FOr instance, how/when do you populate "strKeyPress?" Also, how/when is this snippet being called? |
|
|
|
|
|
#3 |
|
New Member
Join Date: Mar 06
Posts: 2
![]() |
Re: trying to manipulate an automation process
thanks for replyin me sir, sorry silly me .. on form load it will load the agent n blah some instruction. instruction will go like to start doing tutorial pls press the space key n stuff like that..when user acknowledge the instruction they would just press the space button..n would kick the strkeypress = " ENTER" hope to hear from u real soon i will have to show this function to my supervisors tommorow
n i m like new in vb.net coz they didnt allow us to use prog langguage which is not so accepted in the market world today sotherefore vb.net is a whole new world.. to me.. pls help n guide me guess i will paste the whole form code to make yer references easierregards, K VB Code:
|
|
|
|
![]() |
|
||||||
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | Search this Thread |
| Display Modes | |
|
|