home *** CD-ROM | disk | FTP | other *** search
- VERSION 5.00
- Begin VB.Form frm4_3_5
- Caption = "Ceil Function"
- ClientHeight = 2850
- ClientLeft = 1965
- ClientTop = 1695
- ClientWidth = 2370
- 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 = 2850
- ScaleWidth = 2370
- Begin VB.PictureBox picResults
- Height = 1215
- Left = 240
- ScaleHeight = 1155
- ScaleWidth = 1875
- TabIndex = 3
- Top = 1440
- Width = 1935
- End
- Begin VB.CommandButton cmdCalculate
- Caption = "Calculate Ceil"
- Default = -1 'True
- Height = 495
- Left = 240
- TabIndex = 2
- Top = 720
- Width = 1935
- End
- Begin VB.TextBox txtNumber
- Height = 285
- Left = 1200
- TabIndex = 1
- Top = 240
- Width = 975
- End
- Begin VB.Label lblNumber
- Caption = "Enter a number"
- Height = 375
- Left = 240
- TabIndex = 0
- Top = 120
- Width = 735
- End
- Attribute VB_Name = "frm4_3_5"
- Attribute VB_GlobalNameSpace = False
- Attribute VB_Creatable = False
- Attribute VB_PredeclaredId = True
- Attribute VB_Exposed = False
- Private Function Ceil(x As Single) As Single
- 'Round nonintegers up
- Ceil = -Int(-x)
- End Function
- Private Sub cmdCalculate_Click()
- 'Demonstrate the Ceil function
- picResults.Print "Ceil("; txtNumber.Text; ") ="; Ceil(Val(txtNumber.Text))
- txtNumber.Text = ""
- txtNumber.SetFocus
- End Sub
-