VB Script - Simple Calculator Using Procedure Call
Steps to Run: 1] Open Notepad.exe or Notepad++.exe 2] Copy below VB script source code into notepad 3] Save File as "Calculate.vbs" 4] Run file and enter values 'Simple Calculator which take input of two values and pass operator sign (like +, -, *, /) ' Variable Declaration Dim val1,val2,optval,results ' Get Inputbox values into declared variable val1 = CInt(InputBox("Enter First Number Here: ","Title: Enter First Value")) val2 = CInt(InputBox("Enter Second Number Here: ","Title: Enter Second Value")) optval = InputBox("Enter Operator Value e.g. + , * , / , - : ","Title: Enter Operator Value") ' Call to Procedure name <MathCalc>, Pass option value to procedure MathCalc(optval) ' Private procedure call starts Private Sub MathCalc(optval) 'Use select case option to select the operator values Select Case optval Case "+" results = (val1) + (val2) Case "-" ...