home *** CD-ROM | disk | FTP | other *** search
- VERSION 2.00
- Begin Form fFunction
- BackColor = &H00C0C0C0&
- Caption = "VSAwk Function Evaluator App"
- ClientHeight = 4245
- ClientLeft = 1245
- ClientTop = 1605
- ClientWidth = 5325
- Height = 4710
- Left = 1155
- LinkTopic = "Form1"
- ScaleHeight = 4245
- ScaleWidth = 5325
- Top = 1230
- Width = 5505
- Begin VideoSoftAwk VSAwk1
- ConvInfo = FUNCTION.FRX:0000
- FS = " , "
- Left = 0
- Top = 3270
- End
- Begin VideoSoftElastic VSElastic1
- Align = 5 'Fill Container
- AutoSizeChildren= 1 'Even Horizontal
- BevelInner = 7 'Shadow
- BevelInnerWidth = 4
- BevelOuter = 1 'Raised
- BevelOuterWidth = 1
- BorderWidth = 20
- ConvInfo = FUNCTION.FRX:000B
- Height = 3540
- IntBkg = &H00C0C0C0&
- Left = 0
- TabIndex = 0
- Top = 705
- Width = 5325
- Begin GRAPH Graph1
- AsciiColor = "1"
- AutoInc = 0 'Off
- GraphType = 6 'Line
- Height = 2940
- IndexStyle = 1 'Enhanced
- Left = 300
- NumPoints = 30
- TabIndex = 2
- Top = 300
- Width = 4725
- End
- End
- Begin VideoSoftElastic VSElastic2
- Align = 1 'Top
- AutoSizeChildren= 3 'Even Vertical
- BevelOuter = 1 'Raised
- BevelOuterWidth = 1
- BorderWidth = 12
- CaptionPos = 7 'Right Center
- ConvInfo = FUNCTION.FRX:0016
- FontBold = 0 'False
- FontItalic = 0 'False
- FontName = "Arial"
- FontSize = 9.75
- FontStrikethru = 0 'False
- FontUnderline = 0 'False
- Height = 705
- IntBkg = &H00C0C0C0&
- Left = 0
- TabIndex = 1
- TagWidth = 600
- Top = 0
- Width = 5325
- Begin ComboBox Combo1
- BackColor = &H00C0C0C0&
- FontBold = 0 'False
- FontItalic = 0 'False
- FontName = "Arial"
- FontSize = 9.75
- FontStrikethru = 0 'False
- FontUnderline = 0 'False
- Height = 360
- Left = 780
- TabIndex = 3
- Tag = "f(x) = "
- Text = "Combo1"
- Top = 180
- Width = 4365
- End
- End
- Option Explicit
- Dim x!
- Sub Combo1_Click ()
- GraphFunction
- End Sub
- Sub Combo1_KeyPress (KeyAscii As Integer)
- If KeyAscii = 13 Then GraphFunction
- End Sub
- Sub Form_Load ()
- Combo1.AddItem "X^2"
- Combo1.AddItem "X^3"
- Combo1.AddItem "sin(X)*X^2"
- Combo1.AddItem "tan(x)"
- Combo1.ListIndex = 1
- End Sub
- Sub GraphFunction ()
- Dim np%, nerr%
- Dim x1!, x2!
- x1 = -10
- x2 = 10
- VSAwk1 = Combo1
- For x = x1 To x2 Step (x2 - x1) / Graph1.NumPoints
- np = np + 1
- If np <= Graph1.NumPoints Then
- Graph1.ThisPoint = np
- Graph1.XPosData = x
- Graph1.GraphData = VSAwk1.Val
- If VSAwk1.Error Then nerr = nerr + 1
- End If
- Next
- Graph1.DrawMode = 2
- If nerr Then Beep
- End Sub
- Sub VSAwk1_Variable (Variable As String, Value As Single, Accept As Integer)
- If Variable = "X" Or Variable = "x" Then
- Accept = True
- Value = x
- End If
- End Sub
-