| |
drawls
Posts: 4
Score: 0
Joined: 2/11/2008
Status: offline
|
option explicit dim num1 dim num2 dim sum dim diff dim mult dim div num1 = inputbox("Enter the first number.") num2 = inputbox("Enter the second number.") sum = cint(num1) + cint(num2) diff = num1 - num2 mult = num1 * num2 div = num1 / num2 msgbox "The sum is: " & sum & vbcrlf & "The differance is: " & diff & vbcrlf & _ "The multiple is: " & mult & vbcrlf & "The division is: " & div, vbokonly, "Number Products" Set WshNtwk = WScript.CreateObject("WScript.Network") PropertyInfo = "Computer Name" & vbTab & "= " & WshNtwk.ComputerName & vbCrLf & "User Name" & vbTab & "= " & WshNtwk.UserName & vbCrLf titlebar = "User Domain" & vbTab & "= " & WshNtwk.UserDomain MsgBox PropertyInfo, vbOkOnly , titlebar Set WshShl = WScript.CreateObject("WScript.Shell") WshShl.LogEvent 1, "Problem 4" option explicit dim wshshl set wshshl = wscript.createobject("wscript.shell") wshshl.run "wordpad" wscript.sleep 2000 wshshl.sendkeys "****" wshshl.sendkeys "~" wshshl.sendkeys "**********" option explicit dim input1 dim mess input1 = inputbox("Enter a number or letter") if isnumeric(input1) then mess = "The input was a number" else mess = "The input was not a number" end if msgbox mess option explicit dim num1 dim numArray() dim intcount dim strmsg dim count num1 = inputbox("Enter a number for the array") redim numArray(num1) count = 1 for each intcount in numArray strmsg = strmsg & count & " " count = cint(count) + 1 next msgbox strmsg option explicit redim numArray(9) dim newnum dim strmsg dim x dim arrnum arrnum = 0 numArray(0) = 1 numArray(1) = 2 numArray(2) = 3 numArray(3) = 4 numArray(4) = 5 numArray(5) = 6 numArray(6) = 7 numArray(7) = 8 numArray(8) = 9 numArray(9) = 10 redim preserve numArray(10) newnum = inputbox("Enter a number to add to the array") numArray(10) = newnum for each x in numArray strmsg = strmsg & numArray(arrnum) & " " arrnum = cint(arrnum) + 1 next msgbox strmsg
< Message edited by drawls -- 2/11/2008 4:50:49 AM >
|
|