FB II Compiler

PG PRO

Debugging

Memory

System

Mathematics

Resources

Disk I/O

Windows

Controls

Menus

Mouse

Keyboard

Text

Fonts

Drawing

Sound

Clipboard

Printing

Communication

ASM

Made with FB

SOUND

Speak the contents of an Edit Field


You have to establish a speech channnel 'gSpeechChanPrt&' before calling.
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
David