ENTERPROCの注意

EnterProcの関数アドレスを設定する方法が、FB2FB3では違います。

  1. FB2
    CB& =
    LINE "SndCallBack"
  2. FB3
    CB& =
    PROC "SndCallBack"

(Sample)

"SndCallBack"

ENTERPROC

gPlayOff = _ztrue

FN DisposeSndChannel(gSndChanPtr&)

EXITPROC

LOCAL MODE

LOCAL FN SetupChannel(whichSynth,InitParam)

DIM @sndPtr&,CB&,OSErr

sndPtr&=0:' set this to zero to start with

'FB2

'CB&=LINE "SndCallBack":' this is how we specify a callback routine

'

'FB3

CB&=PROC "SndCallBack":' this is how we specify a callback routine

OSErr=FN SNDNEWCHANNEL(sndPtr&,whichSynth,InitParam,CB&)

LONG IF OSErr<>_noErr:' make sure we didn't get an error

sndPtr&=0:' we return a zero

END IF

END FN=sndPtr&:' returns a sound channel pointer