' ------------------------------------------------------------------------- ' From the book Inside Active Directory, ISBN 0-201-61621-1 ' Copyright (C) 2002 by Addison-Wesley ' Script by Sakari Kouti (see http://www.kouti.com) ' You have a royalty-free right to use, modify, reproduce and distribute ' this script (and/or any modified version) in any way you find useful, ' provided that you agree that Addison-Wesley or Sakari Kouti has no ' warranty, obligations or liability for the script. If you modify ' the script, you must retain this copyright notice. ' ------------------------------------------------------------------------- '----------------------------------------------------------------------------------- ' A Basic Example of VBScript '----------------------------------------------------------------------------------- Option Explicit Const MILLIMETERS_PER_INCH = 25.4 'how many mm is one inch Const INCHES_PER_FOOT = 12 'how many inches is one foot Dim intFeetOfHeight 'the foot part of the height Dim intInchesOfHeight 'the inch part of the height Dim intHeightInInches, intHeightInMillimeters, strResult, i intFeetOfHeight = InputBox("Enter just the feet","How tall are you?") intInchesOfHeight = InputBox("Enter the inches","How tall are you?") intHeightInInches = intFeetOfHeight * INCHES_PER_FOOT _ + intInchesOfHeight intHeightInMillimeters = MILLIMETERS_PER_INCH * intHeightInInches strResult = "Your height in centimeters is " & _ Round(intHeightInMillimeters / 10) 'convert mm to cm If intHeightInMillimeters >= 2000 Then strResult = strResult & vbCrLf & "Have you considered basketball?" End If strResult = strResult & vbCrLf & vbCrLf 'add linefeed and empty line For i = 65 To 74 strResult = strResult & " " & Chr(i) Next Call MsgBox(strResult,vbOKOnly + vbExclamation,"The Results")