Simple vbs script calculator

Simple vbs script calculator

Awesome
  50% (6)
Works
  25% (3)
Doesnt work
  8% (1)
Poor
  16% (2)

Total Votes: 12

Author Message
CØLLØSUS

  • Total Posts : 21
  • Scores: 2
  • Reward points : 0
  • Joined: 1/3/2011
  • Status: offline
Simple vbs script calculator Sunday, January 09, 2011 8:28 PM (permalink)
0
I Simple calculator, i hope it works
do
Dim a
a=inputbox("put in your number:")
b=inputbox("number you would like to multiply:")
if not isnumeric (a) then
wscript.quit
end if
if not isnumeric (b) then
wscript.quit
end if
c=msgbox("Your Answer: "& a * b)
loop
 
#1
    ehvbs

    • Total Posts : 3321
    • Scores: 110
    • Reward points : 0
    • Joined: 6/22/2005
    • Location: Germany
    • Status: offline
    Re:Simple vbs script calculator Monday, January 10, 2011 3:01 AM (permalink)
    0
    Less than poor, because:
    • the script serves no purpose
    • the UI is rotten: asking for a number before telling about the operation, no feedback for bad input
    • bad practices: no "Option Explicit", lousy variable names, unused variable
     
    #2
      4CAMan

      • Total Posts : 11
      • Scores: 0
      • Reward points : 0
      • Joined: 1/9/2011
      • Location: VA, United States of America
      • Status: offline
      Re:Simple vbs script calculator Monday, January 10, 2011 3:21 PM (permalink)
      0
      corrected (with minor improvement) 
      ================================
      Option Explicit
      Dim a, b, c
      a=inputbox ("put in your number: ", "Multiplication- First Number")
      b=inputbox ("number you would like to multiply:", "Multiplication- Second Number")
      if not isnumeric (a) then
      wscript.quit
      end if
      if not isnumeric (b) then
      wscript.quit
      end if
      c=msgbox ("Your Answer: "& a * b, vbCritical, "Answer")
       
      #3
        Brandon Flyte

        • Total Posts : 3
        • Scores: 0
        • Reward points : 0
        • Joined: 1/10/2011
        • Status: offline
        Re:Simple vbs script calculator Monday, January 10, 2011 10:36 PM (permalink)
        0
        Well.. it works...
         
        #4

          Online Bookmarks Sharing: Share/Bookmark

          Jump to:

          Current active users

          There are 0 members and 1 guests.

          Icon Legend and Permission

          • New Messages
          • No New Messages
          • Hot Topic w/ New Messages
          • Hot Topic w/o New Messages
          • Locked w/ New Messages
          • Locked w/o New Messages
          • Read Message
          • Post New Thread
          • Reply to message
          • Post New Poll
          • Submit Vote
          • Post reward post
          • Delete my own posts
          • Delete my own threads
          • Rate post

          2000-2012 ASPPlayground.NET Forum Version 3.9