Home
Fen
RSS Feeds
Learning Resources
The Information Age
Projects
Network Essentials
Homezones
Bert Lutman
A.W.Jackson

 

more pages

 

Am I Java enabled ?
Clone XP Pro
Database Webs
Do I have Flash ?
Extending Your Webs
IIS Virtual Folders
.NET
Password for sub-web
Pull-down Menu
Recovering XP
Using a Router as a Firewall
Sharing Files using FTP
Tweaking XP Pro
VB6
VBScript
XP Firewall

 

 

 

 


VBScript

VBScript began its life as a client-side scripting language and some of the examples shown below do indeed operate as such. In these cases one typically surrounds the VBScript as shown:

<SCRIPT LANGUAGE="VBScript">

<!--
    This is where you declare your variables and put your subroutines and functions
    (The <!--  --> tags are used to hide the code from browsers unable to read VBScript)

-->
</SCRIPT>

 

The main disadvantage of using VBScript as a client-side scripting language is the fact that it is unlikely to be read by browsers other than Internet Explorer.


VBScript's real usefulness is as a server-side scripting language. It is perfectly possible to have server-side scripting in VBScript and client-side scripting in Javascript on the same page, and each can call the other's functions and subroutines provided they have been properly delimited.

 
When VBScript is written for server-side routines the script delimiter changes as shown:

 

<SCRIPT LANGUAGE="VBScript"  RUNAT="Server">

 

However, because one of VBScript's most important functions is to develop ASP (Active Server Pages) and ADO (ActiveX Data Objects) you are also likely to encounter the following notation where code is placed between the script tags (<% %>). (Note that asp code is not visible in a 'view source' window)

 

<%@ Language=VBScript %>
<html>

        html code etc

<%
       vbscript asp code 
%>

        html code etc

</html>

 

If you include the ASP script delimiters <% %> then the page must be saved with the .asp extension.

 

VBscript users can get into difficulties when mixing server-side and client-side script. This discussion illustrates the point 

Here are a few examples of client-side and server-side scripts: (some derived from "VBScript in a Nutshell", Childs Lomax and Petrusha, published by O'Reilly, ISBN 1-56592-702-6)

 

inches (htm)
cube (htm)
name
(htm)
region (htm)
region (asp) To see the source click here
variable  (asp) To see the source and an explanation click here
server (asp) To see the source and an explanation click here
array1 (htm)  static array
array2 (asp)  static array  - to see the source click here
array3 (htm)  dynamic array - for source and comment click here
array4 (htm) dynamic array using UBound function
array5 (asp) multi-dimensional array - to see the source click here

 

Learning Resources Page

 

 
 
   

Copyright 2008 [Fen Tyler]