Computers - Software Hardware : I need help with VBScripting

Discussion in 'Computers - Hardware Software' started by blazejay, May 12, 2012.

  1. blazejay Active Member

    Member Since:
    Apr 14, 2012
    Message Count:
    153
    Likes Received:
    85
    Trophy Points:
    28
    Gender:
    Male
    Hi,

    I got a question in two parts.
    First part is there anyone here that can help tutor me in scripting?

    Second part can anyone just help me understand what to do?

    I have a scripting/programming class that is a real pain.
    I read everything ask to read and follow the instructions and codes that was provided and I still have errors in completing the task.
    I was not given too much info on anything so I am basically on my own and my professor said the codes/program,etc... was correct just type it in as is.

    When I run the program it gets half of it correct but it always don't execute the other part of the program.
    To make matters worse the professor gives solutions in riddles and it's hard to figure out the solution to the problem by following his answer.
    I need this class bad and I am a few step from graduating help me please!!!!
    Destee likes this.
  2. Shikamaru Well-Known Member

    Member Since:
    May 7, 2011
    Message Count:
    3,646
    Likes Received:
    1,946
    Trophy Points:
    113
    Gender:
    Male
    What'cha need :)?

    I should be able to help you with your VBScripting.

    Scripting is a bit easier than programming.

    Scripts are interpreted versus programs which are complied.

    First things first. Do you understand the concept of variables, loops, conditionals, etc.?
    It helps to make your script (or program) as modular as possible with regard to its source code.

    VBScript can either be ran through a browser or command-line (Windows Script Host).

    I believe Gorilla is a programmer. He may jump in if he sees this.

    What version of Windows are you running on?
    What version of Windows Scripting Host do you have installed?
    What version of Internet Explorer do you have installed?
    The reason for this line of questioning is to ascertain your environment.

    Could you also furnish the instructions of your assignment as well as the source code that is causing you issues?
  3. Khasm13 Well-Known Member

    Member Since:
    Mar 26, 2003
    Message Count:
    9,152
    Likes Received:
    2,109
    Trophy Points:
    113
    visual basic was a breeze after messing with cobol and fortran....
    u don't know how good u have it son....

    one love
    khasm
  4. blazejay Active Member

    Member Since:
    Apr 14, 2012
    Message Count:
    153
    Likes Received:
    85
    Trophy Points:
    28
    Gender:
    Male
    Windows 7
    WSH version 5.8
    Latest version of IE

    I am going to provide screen shot of the instruction and source code, also the professor code.

    This is the instruction and code:


    · Sorry I could not paste a screen shot but here's what I was told to use that cover this task and the last:




    ' VBScript: PopuoWindow.vbs

    ' Written by: Student Name

    ' Date: Today's Date

    ' Class: COMP230

    ' Professor: Professor Name

    ' ==============================================

    'Create name and age variables

    msgStr = ""

    Set args = WScript.Arguments

    If args.Count < 2 then

    WScript.Echo "You must enter the name and age as Command Line Arguments!!"

    WScript.Sleep(5000)

    WScript.Quit

    end If

    name = args.item(0)

    ageStr = args.item(1)

    age = 0

    msgStr = msgStr & "Your name is " & vbTab & vbTab & name & vbCrLf

    msgStr = msgStr & "Your age is " & vbTab & vbTab & ageStr & vbCrLf

    age = CInt(ageStr)

    msgStr = msgStr & vbCrLf & "Your Age in 10 years will be ...... " & _

    CStr(age+10) & vbCrLf

    msgStr = msgStr & "End of Program"

    WScript.Echo msgStr

    'Pause Routine

    WScript.Sleep(6000)



    I understand the header,etc... but what I have problems with is:

    1. The instruction ask to delete a part of the code out and I am assuming from this he want us to change it.

    2. When I execute it or run it it will just output the comments,but does not give the name,age, and age calculation.

    3.The code above does not give me too much detail what to do or how to accomplish the required results he wanted.
  5. blazejay Active Member

    Member Since:
    Apr 14, 2012
    Message Count:
    153
    Likes Received:
    85
    Trophy Points:
    28
    Gender:
    Male
    Is there anyway to attach a file to a post? because the document I have when copy and paste keep saying error can't send a email or link when it is not a link.
    Destee likes this.