User`s guide

Spectral Analysis Example
'Cancel button click event handler. Exits form without computing fft
'or updating variables.
Unload Me
End Sub
Private Sub btnOK_Click()
'OK button click event handler. Updates state of all variables from controls
'and executes the computefft or plotfft method.
Dim R As Range
If theFourier Is Nothing Or theFFTData Is Nothing Then GoTo Exit_Form
On Error Resume Next
'Process inputs
SetR=Range(refedtInput.Text)
If Err <> 0 Then
MsgBox ("Invalid range entered for Input Data")
Exit Sub
End If
Set InputData = R
Interval = CDbl(edtSample.Text)
If Err <> 0 Or Interval <= 0 Then
MsgBox ("Sampling interval must be greater than zero")
Exit Sub
End If
'Process Outputs
SetR=Range(refedtFreq.Text)
If Err = 0 Then
Set Frequency = R
End If
SetR=Range(refedtReal.Text)
If Err = 0 Then
theFFTData.Real = R
End If
SetR=Range(refedtImag.Text)
If Err = 0 Then
theFFTData.Imag = R
End If
SetR=Range(refedtPowSpect.Text)
If Err = 0 Then
Set PowerSpect = R
End If
3-23