April 26, 2024, 07:25:25 PM

News:

Own IWBasic 2.x ? -----> Get your free upgrade to 3.x now.........


@CONTROLID, problem

Started by hugh, September 02, 2009, 09:11:28 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

hugh

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

LarryMc

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
LarryMc
Larry McCaughn :)
Author of IWB+, Custom Button Designer library, Custom Chart Designer library, Snippet Manager, IWGrid control library, LM_Image control library

hugh

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