[futurebasic] FB3 Speech

Message: < previous - next > : Reply : Subscribe : Cleanse
Home   : October 1999 : Group Archive : Group : All Groups

From: Dabs@...
Date: Sat, 23 Oct 1999 23:00:53 EDT
The problem to the speech error was simple.  I placed a # sign in front of 
the pointer to the text record.   Yay!

Thanks
David


CLEAR LOCAL

'__________________________________________________

LOCAL FN SpeakEditField(EFNum)

'__________________________________________________

DIM TeHndl&,NumChar%,textHndl&

TeHndl& = TEHANDLE(EFNum)

StartChar% = TeHndl&..teSelStart%

EndChar% = TeHndl&..teSelEnd%

NumChar% = TeHndl&..teLength%

textHndl& = TeHndl&..teTextH&

hState = FN HGETSTATE(textHndl&)

OSErr = FN HLOCK(textHndl&)
textpointrec& = [textHndl&]+StartChar%

LONG IF EndChar% > StartChar%

   LONG IF gSpeechChanPtr&

     OSErr = FN SpeakText(gSpeechChanPtr&,#textpointrec&,EndChar%-StartChar%)

   END IF

END IF

OSErr = FN HSETSTATE(textHndl&,hState)

END FN = OSErr