Private Sub Command1_Click()
'PROGRAM D12R4
'Driver for routine SINFT
EPS = 0.001
NP = 16
NPP2 = NP + 2
Width1 = 30#
PI = 3.14159
Dim DATA(16), SIZE1(16)
N = NP / 2
Print
Print Tab(5); "Period of sinusoid in channels (2-";
Print Format$(NP, "##"); "; or 0 to stop)"
PER = 16
If PER For I = 1 To NP
DATA(I) = Sin(2# * PI * (I - 1) / PER)
Next I
Call SINFT(DATA(), NP)
BIG = -10000000000#
SMALL = 10000000000#
For I = 1 To NP
If DATA(I) < SMALL Then SMALL = DATA(I)
If DATA(I) > BIG Then BIG = DATA(I)
Next I
SCAL1 = Width1 / (BIG - SMALL)
For I = 1 To NP
NLIM = Int(SCAL1 * (DATA(I) - SMALL) + EPS)
Print Tab(5); Format$(I, "##");
For J = 1 To NLIM + 1
Print "*";
Next J
Next I
Call SINFT(DATA(), NP)
BIG = -10000000000#
SMALL = 10000000000#
For I = 1 To NP
If DATA(I) < SMALL Then SMALL = DATA(I)
If DATA(I) > BIG Then BIG = DATA(I)
Next I
SCAL1 = Width1 / (BIG - SMALL)
For I = 1 To NP
NLIM = Int(SCAL1 * (DATA(I) - SMALL) + EPS)
Print Tab(5); Format$(I, "##");
For J = 1 To NLIM + 1
Print "*";
Next J
Next I
End Sub