Home Automated Living Forums > HAL Advanced Topic > HALi » AskListContext working for anyone

HALi HALi is an Actixe X interface that allow more advanced programming with HAL. Search this forum on how to create HALi Apps as well as find apps that others have already created.

Reply
 
Thread Tools Display Modes
Old 12-15-2009, 06:53 PM   #1
BDD43
Advanced Member
 
Join Date: Jul 2009
Posts: 157
Default AskListContext working for anyone

I am trying to use the following:

Dim AnsCall - AxHALi1.TTX.AskListContext("Who?", 3, 60, "Darrin, Donna,")

If AnsCall="Donna" then
AxHALi1.Macros.ItemByName(Get Donna).Play()
END IF


I can't seem to get the variable string AnsCall filled with anything.

Any Ideas? I read where others posted in 2008 were having problems, but not sure if they ever got it working.
BDD43 is offline   Reply With Quote
Old 12-15-2009, 08:19 PM   #2
JimMcGowanInlet
Super Moderator
 
JimMcGowanInlet's Avatar
 
Join Date: Jul 2003
Location: NJ
Posts: 3,050
Default Re: AskListContext working for anyone

What language is that? it looks like VB but your dim statement looks strange. For VB I would expect

Dim AnsCall as String
AnsCall = AxHALi1.TTX.AskListContext("Who?", 3, 60, "Darrin, Donna,")
__________________
DISCLAIMER: Use my advice at your own risk. If you are not familiar with how to safely accomplish a task HIRE A PROFESSIONAL. Improper use/installation can cause damage to equipment, fire, electrical problems and in some cases death.
JimMcGowanInlet is offline   Reply With Quote
Old 12-15-2009, 09:39 PM   #3
BDD43
Advanced Member
 
Join Date: Jul 2009
Posts: 157
Default Re: AskListContext working for anyone

I have what you have listed in the code.

But it doesn't ever fill the string...even if I put one response in and regardless where I put commas.
BDD43 is offline   Reply With Quote
Old 12-16-2009, 10:07 AM   #4
BDD43
Advanced Member
 
Join Date: Jul 2009
Posts: 157
Default Re: AskListContext working for anyone

Does anyone use this and got it to work??
BDD43 is offline   Reply With Quote
Old 12-16-2009, 11:22 AM   #5
JimMcGowanInlet
Super Moderator
 
JimMcGowanInlet's Avatar
 
Join Date: Jul 2003
Location: NJ
Posts: 3,050
Default Re: AskListContext working for anyone

I'll try it out later today. Does it timeout or does it return immediatly?
__________________
DISCLAIMER: Use my advice at your own risk. If you are not familiar with how to safely accomplish a task HIRE A PROFESSIONAL. Improper use/installation can cause damage to equipment, fire, electrical problems and in some cases death.
JimMcGowanInlet is offline   Reply With Quote
Old 12-16-2009, 11:54 AM   #6
BDD43
Advanced Member
 
Join Date: Jul 2009
Posts: 157
Default Re: AskListContext working for anyone

I set it for 420 and it seems to pause breifly, but it never fills the string with a response.
BDD43 is offline   Reply With Quote
Old 12-16-2009, 06:46 PM   #7
BDD43
Advanced Member
 
Join Date: Jul 2009
Posts: 157
Default Re: AskListContext working for anyone

Jim,
any luck getting it to fill the string?
BDD43 is offline   Reply With Quote
Old 12-16-2009, 07:15 PM   #8
JimMcGowanInlet
Super Moderator
 
JimMcGowanInlet's Avatar
 
Join Date: Jul 2003
Location: NJ
Posts: 3,050
Default Re: AskListContext working for anyone

Well my wife stole my microphone but I did mange to figure out what the problem probably is. The iDelay is in mili Seconds so 60ms is too quick. The maximum value of iDelay is 10,000 or 10 seconds. So maybe try iDelay at 5000. That should be enough time to respond.

Also do not put spaces in your responses. For example use "Up,Down,Left,Right" do not use "Up, Down, Left, Right"

From the HALi manual.


AskListContext
(sText As String, iDelay As Integer, iRetries As Integer, sList As String) As String

Returns the spoken choice from a list of words provided.

The method parameters are:

Parameter Description

iWhich A number representing the ordinal position of the object in HAL.
sText A String containing the Text HAL should Speak
sContext A String containing the Specified Context.
iRetries An Integer containing the number of retries.
iDelay An Integer containing the number of mSeconds to wait
sList A string containing a comma “,” separated list of words to ask in context.

Max of 100 words.


Hope that helps.
Jim
__________________
DISCLAIMER: Use my advice at your own risk. If you are not familiar with how to safely accomplish a task HIRE A PROFESSIONAL. Improper use/installation can cause damage to equipment, fire, electrical problems and in some cases death.

Last edited by JimMcGowanInlet; 12-16-2009 at 07:24 PM.
JimMcGowanInlet is offline   Reply With Quote
Old 12-16-2009, 07:29 PM   #9
BDD43
Advanced Member
 
Join Date: Jul 2009
Posts: 157
Default Re: AskListContext working for anyone

I will give it a try and let everyone know.

Thanks greatly!
BDD43 is offline   Reply With Quote
Old 12-16-2009, 08:13 PM   #10
BDD43
Advanced Member
 
Join Date: Jul 2009
Posts: 157
Default Re: AskListContext working for anyone

THAT WORKED!!!!!!

Thank you so much. Now I can continue my coding.
I did have to put a comma at the end of the list as stated in another post.
--
Dim AnsCall as String
AnsCall=AxHALi1.TTX.AskListContext("Who?", 3, 5000, "Darrin, Donna,Zachary,")

msgbox(AnsCall)
--
BDD43 is offline   Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump



All times are GMT -6. The time now is 08:25 AM.



Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
© 2001-2010 Home Automated Living. All Rights Reserved.