Scripting Engine > Script Examples

Capture Input and Calculation

This simple script requests the age of the user and calculates how many year to retirement:

' Algebra

YourAge = 21  ' Not!!!

With BigInput

       .Caption = "What is your age?"

       .Text = YourAge

       .ShowModal

       If Not .Cancel Then YourAge = clng(.Text)

End With

PensionAge = 65

Output.textbox = "Age: " & YourAge & _

", therefore Years to retirement = " & PensionAge – YourAge

 

When executed, the following dialogue is displayed:

Followed by the output: