Amazon.com: PC Books || Educational Software || Magazines
Amazon: Books-CA || Software-CA || Books-UK || Software-UK

HTML | Javascript | ASP | PHP | VBScript | SQL | Hardware | PC FAQ| WinXP|

Learn to Build, Upgrade, or Repair your Computer Ebook + PC Safety 101 kwwebservice.com Reasonably priced web development & hosting
VBS Basics
Introduction
Variables & Arrays
Sub & Function Procedure
If Statements
Case Statements
Loop Statements
Operators
Forms
MsgBox Function
Books @
CA Amazon
UK Amazon
US Amazon
 

VB Script?

VBScript is a script version of visual basic supported by Internet Explore 3.0 and above. With VB Script, you can make your web site dynamic and interactive.  VB Script code is interpreted as an script by the browser and Visual Basic terms are used.  For example declaring a variable, writing sub, or function in VB Script is done similar to Visual Basic but keep in mind that Visual Basic is programming language for applications while VB Script is small script version coded with HTML or ASP documents.

To place VB Script with ASP or HTML document, use <script language = "vbscript">. With this term script tells the browser that the content from this tag to the end tag </script> to be interpreted as script language. We also inform the browser that this is a VB Script by setting the language equal to "vbscript". VB Script code can be placed in head or body section of any HTML document depend on the favored result. The head section is good place to insert any procedures while the body section is good place to execute the final results.


Here is an small example that defines a variable, uses input box to grab the users name, stores the user name in the defined variable and places it on the page.
<html>
<head>
<script language="vbscript">
  Option Explicit
  Sub GetUserName()
     dim name
      name=inputbox("Enter your name:")
     document.write("Your name is: " & name)
  end sub
</script>
</head>
<body>
 <script language="vbscript">
       call GetUserName()
 </script>
</body>
</html>
Variable name was defined in the sub procedure GetUserName. Sub procedure is aware of whatever defined and evaluated in it. It does not return a value as the function does in vb script. Then the name variable was set to input box. This prompts an interface to the user and whatever user enters is stored back into the variable. Every sub must be closed with end sub. Option explicit catches any undeclared variables. It's good programming habit to declare all your variables. Finally, the sub is called. The expected result was to write the name on the browser.

Variables & Arrays
Bluehost.com Web Hosting $6.95
PC System Tools
SpyCleaner
Registry Mechanic
4Diskclean Pro
Health PC Club
TweakNow
Registry Washer
SpyAnyWhere
System Lifeguard
...More/Details

PC Articles
  Computer Safety
prevent viruses & Spyware