All pastes #466141 Raw Edit

Untitled

public text v1 · immutable
#466141 ·published 2007-04-30 20:52 UTC
rendered paste body



Public Sub Main()
'Start function Main
    Dim Height As Single, Width As Single, Square As Single
    'create Height, Width and Square variables as decimal fraction
    Dim Message As String
    'create Message variable as text string
    Height = 0
    Width = 0
    Square = 0
    Message = ""
    'Configure default variables values
    
    
    Height = InputBox("Please give the height of the triangle", "Square Check", 0)
    'request the user for the height value and put this into Height variable
    Width = InputBox("Please give the width of the triangle", "Square Check", 0)
    'request the user for the width value and put this into Width Variable
    Square = Height * Width / 2
    'Do required operation and store the result into Square variable
    Message = "The square of the triangle is " & Square & vbCrLf
    'create message with value of Square and line break constant vbCrLf
    MsgBox Message, vbOKOnly, "Square Check"
    'show to user the message box with prepared message
End Sub
'Finish function Main