home *** CD-ROM | disk | FTP | other *** search
- VERSION 5.00
- Begin VB.Form frm4_2_6
- Caption = "Form-level Variables"
- ClientHeight = 2100
- ClientLeft = 1095
- ClientTop = 1485
- ClientWidth = 3270
- BeginProperty Font
- Name = "MS Sans Serif"
- Size = 8.25
- Charset = 0
- Weight = 700
- Underline = 0 'False
- Italic = 0 'False
- Strikethrough = 0 'False
- EndProperty
- LinkTopic = "Form1"
- PaletteMode = 1 'UseZOrder
- ScaleHeight = 2100
- ScaleWidth = 3270
- Begin VB.PictureBox picResults
- Height = 855
- Left = 360
- ScaleHeight = 795
- ScaleWidth = 2355
- TabIndex = 1
- Top = 960
- Width = 2415
- End
- Begin VB.CommandButton cmdDisplay
- Caption = "Display Results"
- Height = 495
- Left = 480
- TabIndex = 0
- Top = 240
- Width = 2175
- End
- Attribute VB_Name = "frm4_2_6"
- Attribute VB_GlobalNameSpace = False
- Attribute VB_Creatable = False
- Attribute VB_PredeclaredId = True
- Attribute VB_Exposed = False
- Dim num1 As Single, num2 As Single
- Private Sub cmdDisplay_Click()
- 'Display the sum of two numbers
- num1 = 2
- num2 = 3
- picResults.Cls
- Call AddAndIncrement
- picResults.Print
- picResults.Print "num1 = "; num1
- picResults.Print "num2 = "; num2
- End Sub
- Private Sub AddAndIncrement()
- 'Display numbers and their sum
- picResults.Print "The sum of"; num1; "and"; num2; "is"; num1 + num2
- num1 = num1 + 1
- num2 = num2 + 1
- End Sub
-