VBScript TutorialIntroductionVBScript Editors VBScript Syntax VBScript Variables VBScript Arrays VBScript Date VBScript If Statements VBScript Select Case VBScript While Loop VBScript For Loop VBScript Operators VBScript Functions Summary |
VBScript SyntaxWhat VBScript syntax refers to, is a set of rules that determine how the language will be written (by the programmer) and interpreted (by the browser or server). The VBScript syntax is based on the Visual Basic (VB) syntax. VB is a full blown programming environment and VBScript is a scaled down version of VB. You may also find the VBScript syntax similar to JavaScript in some ways. If you know JavaScript, or any other language for that matter, you will be familiar with terms such as variables, functions, statements, operators, data types, objects etc. VBScript includes these too. Most of these will be covered throughout the rest of this tutorial. For now, we'll start with the basics. Basic VBScript CodeHere's some basic VBScript that outputs some text to the browser. Again, if you know JavaScript, this will look familiar.
This results in:
VBScript is similar to JavaScript, but different.
Explanation of Code
ConcatenationWhen writing large blocks of text to the screen, you may need to break your code up over many lines. To ensure this doesn't affect the output, you can use an underscore to indicate a concatenation (joining two lines together).
This results in:
The VBScript syntax allows you to concatenate multiple lines together, so that they appear joined together seamlessly
Where to Put Your Scripts?You can place your scripts in any of the following locations:
|
Need Website Content?
Get unique, quality digital content for your website.
|