learn vbscript – part 1 of 4

14
Learn VBScript – Part 1 of 4 www.srinimf.com

Upload: srinimf-techjobsbizsuccess

Post on 23-Jan-2015

299 views

Category:

Technology


0 download

DESCRIPTION

Learn VBScript – Part 1 of 4 in your spare time.

TRANSCRIPT

Page 1: Learn VBScript – Part 1 of 4

Learn VBScript – Part 1 of 4

www.srinimf.com

Page 2: Learn VBScript – Part 1 of 4

What is VBScript

• VBScript is a scripting language. It is designed to allow you to write scripts that can automate any number of activities, such as adding simple animation to a web page. • Unlike some programming languages VBScript

cannot run on its own.• It requires an execution host. An execution host

is another program, such as a web browser, that interprets and executes your script.

Page 3: Learn VBScript – Part 1 of 4

Usage of VBScript

• Validating HTML forms before submitting their contents as email. • Creating animation effects such as a rollover,

which changes the appearance of a graphic, such as a button, when the mouse moves the pointer over it. • Creating rotating banners.• Interacting with visitors using pop-up dialogs

to display messages and collect information etc.

Page 4: Learn VBScript – Part 1 of 4

Where?

VBScripts executed in Internet ExplorerWindows Script Host Internet Information Server and ASPOutlook ExpressMicrosoft Windows Script Console

Page 5: Learn VBScript – Part 1 of 4

VB Family

•Visual Basic•Visual Basic for Applications•VBScript

Page 6: Learn VBScript – Part 1 of 4

Integrating Code• VBScript is inserted or embedded into an HTML

page using the <SCRIPT> and </SCRIPT> tags. The script tags can be placed in either the head or body section of an HTML page.• There are two forms of the script tags that you’ll

see presented in this book. • The most commonly used syntax is shown here:

<SCRIPT LANGUAGE="Script_Language" TYPE="TEXT/Language" SRC="url"> </SCRIPT

Page 7: Learn VBScript – Part 1 of 4

Script in HTML Page

<HTML> <HEAD> <TITLE>Script 1.1 - Adding VBScript to a HTML page</TITLE> <SCRIPT LANGUAGE="VBScript"> sub window_onload msgbox "Welcome to the world of VBScripting!" end sub </SCRIPT> </HEAD> <BODY> <H3>My first VBScript! </BODY> </HTML>

Page 8: Learn VBScript – Part 1 of 4

WSH

• Also called windows scripting host• VBScript’s role as a client-side Internet

scripting language • You can install or upgrade to WSH version

5.6 on any Windows 95 or later operating system. You can download WSH 5.6 from www.msdn.microsoft.com/scripting

Page 9: Learn VBScript – Part 1 of 4

WSH Architecture

Page 10: Learn VBScript – Part 1 of 4

VB Script basics

• VBScript is saved as a plain text file using a .vbs file extension that uses only VBScript programming statements.• 'Script 1.5—An example of a WSH VBScript

Wscript. Echo "This script works differently depending on which WSH execution environment runs it!"

Comment

Page 11: Learn VBScript – Part 1 of 4

Cont.…

•Wscript.exe and Cscript.exe execution environments provide equivalent functionality

Page 12: Learn VBScript – Part 1 of 4

Running VBScript in Command mode

Page 13: Learn VBScript – Part 1 of 4

What next

•This is just part-1. I will post all relevant topics on VBScript in my coming posts - Part-2, Part-3,Part-4

Page 14: Learn VBScript – Part 1 of 4

Thank Youwww.srinimf.com