How to Learn VBS

Visual Basic Script (VBS or vbscript) is a light programming language that Internet browsers and computers use to talk to each other. It is very different from its parent programming language, Visual Basic. The first, is simply a collection of rules computers and browsers use to distinguish paragraphs, videos or even photos. The Internet absorbs those groups of information and punches it out in a way that people can recognize (to a computer, a video and photograph are basically the same.). The latter, is an extremely intricate way software engineers use to write their programs or develop applications, like Notepad, for example. You can practice learning VBS using your Notepad application already installed on all Microsoft operating systems.

Things You'll Need

  • Internet, computer, and word processing skills
  • Basic HTML and JavaScript language
  • Internet access
  • PC or laptop
  • Notepad application
Show More

Instructions

  1. Learn VBS

    • 1

      Open a new Notepad file with an html extension. Save it to your desktop. Reopen the file by right-clicking the Web page icon. Click "Open With" and then choose the Notepad option. A blank file will pop up. Place this symbol "<html>" at the top of your page. Put a body (<body>) tag under it. You're now ready to enter your VBS.

    • 2

      Type part of the vbscript (<script) tag under the body (<body>) tag. Identify the programming language you will be using. Do this by hitting the space bar one time, and then by writing type="text/vbscript". Put a right angle bracket after this: ">". A good example should look like this: "<script type="text/vbscript"></script>.

    • 3

      Use the document.write statement with parentheses and quotes. This is the way VBS allows text to appear on a Web page (It also ensures the code (VBS in this case) used to speak to Internet browsers doesn't show up when you don't want it to. Common Web "Error" messages often display the VBS the runs underneath the text people are supposed to see.). Learn VBS by writing this string of computer vocabulary: "<html><body><script type="text/vbscript">document.write("This sentence will appear on a Web page.")</script></body></html>. Save your Notepad file to your desktop when you are done. Edit your work by simply reopening your file. Remember to save it with an html extension.

    • 4

      Opt to place your vbscript into a head (<head>) tag. This only applies if you want the code to run before a Web page opens. Write the word "function" and then "myFunction()". Place the word "alert" underneath on the next line. Type "("This is a message for you!")" and then write "end function" on the line just below, yet again. Place a closed head (</head>) after that. The whole thing should look like this: <html><head><script type="text/vbscript">function myFunction()alert("This is a message for you!")endfunction</script>". Move your cursor inside the first body tag (<body>) and then write the follow just right of the y: "onload="myFunction()". It should look like this: "<body onload="myFunction()">". Place head tags right after the first html tag (Remember the one you put at the top of your page?) on the top of your page. Write the closed head (</head>) after end script (</script>)

Learnify Hub © www.0685.com All Rights Reserved