IonicWind Software

IWBasic => General Questions => Topic started by: hugh on September 02, 2009, 09:11:28 PM

Title: @CONTROLID, problem
Post by: hugh on September 02, 2009, 09:11:28 PM
The following is a piece of code from my bingo program, which i am now working due to a hard drive malfunction.
I have either 75 or 90 numbers, each is a Button, when a line or house is checked, the user clicks on the numbers being called back to him/her to verify the number has been called, my problem is, if the user clicks on a number which has not been called, the sapi voice speaks that number, i cant find a way around it to make it NUL, ie say nothing, just to speak on the numbers which have been highlighted on the screen, every number which has been called is stored in in sequence they are called, in OUT[mycount]  ,mycount is the total numbers which have been called.

                          case @idcontrol
select @controlid:
DEFAULT: /* check what number has been clicked, if voice or author is [ON] then say the number */
if @CONTROLID >=1 and @CONTROLID <= number AND answer$ ="yes" THEN
sayit = val(ltrim$(str$(@controlid)))
PLAYWAVE "c:\\computerised_bingo\\sounds\\"+(ltrim$(str$(sayit)))+".wav",@SNDSYNC
elseif computer$="yes" and @CONTROLID >=1 AND @CONTROLID <=number
sayit = val(ltrim$(str$(@controlid)))
IDispatch speech
speech = createComObject("Sapi.SPVoice","")
callOBjectMethod(speech,".SPeak(%s,0)",""+str$(sayit))
speech->release()
ENDIF
/code]

I am trying to find a solution to see if i can use the OUT[mycount],
i thought i could use the controls difference in colors,
as when a number is called, its color is brightened,
i cant find a way around that either. any helpers on this please.
regards
Hugh
Title: Re: @CONTROLID, problem
Post by: LarryMc on September 02, 2009, 09:21:20 PM
If I understand what you are wanting:

int i
for I=1 to mycount
   if @CONTROLID =OUT[i]
      'play the speech
      breakfor
   endif
next i


Larry
Title: Re: @CONTROLID, problem
Post by: hugh on September 03, 2009, 07:55:29 AM
Thanks Larry, with a bit of mixing i got your code working, i had to put the
BREAKFOR
ENDIF
NEXT i

after ;  speech->release()

thanks again.

Hugh