Various Applications and Program Implementation of VBScript Research Proposal

Total Length: 1584 words ( 5 double-spaced pages)

Total Sources: 0

Page 1 of 5

VBScript

Description of program (script)

Source Code with detailed comments

Source Code should contain

a.VBScript Introduction: Variables, Constants, and Data Types

b.VBScript Output Methods, VBScript Input Methods

c.VBScript Decision-Making Statements

d.VBScript Loop Structures and Arrays

e.VBScript Procedures and Functions

f.VBScript File Input/Output Methods

Explain the output along with screenshots of the output

VBScript refers to a scripting language that is developed by Microsoft to develop a Microsoft product such as Internet Explorer. The Internet Explorer has undergone many changes and has been used as a default scripting language. The Microsoft created VBScript to assist web developers to create dynamic web pages for the Internet Explorer viewers. Although HTML (HyperText Markup Language) can be used to develop a website, however, HTML has some shortcomings in developing interactive web pages. Typically, VBScript has unlocked many tools such as ability to access web server, file system and print current time and date. The VBScript also allows web developers to create dynamic web applications. It is essential for ASP (Active Server Pages) developers to learn VBScript before attempting to develop a sophisticated ASP programming.

Objective of this project is to explore the Vbscript (scripting language).

2.Description of script (program)

The paper uses the "Big World" concept to write the first script of the Vbscript. The use of HTML assist in writing a simple scripts.







document.write ("Big World")







Result:

Big World

Using the ASP source, the VBScript can be written as follows:













Result:

Here is the first VBScript!

Note:

VBScript can only be displayed on the Internet Explorer browser. All the VBScript code should include the script tags "text/vbscript," hence the VBScript program will not function properly.

Source Code with Detailed Comments

VBScript Code

Unlike other programming languages that place semi-colons at the end of all the statements, however, semi-colon is unnecessary when writing the VBScript. The following VBScript code reveals the VBScript program without semicolon.



document.write ("No semicolons")

document.write (" are necessary in developing ")

document.write (" this program!")



Display:

No semicolons are necessary in developing this program.

vbscript multiple line syntax

VBScript also uses the special character to display the code that has multiple line. In this case, the VBScript uses the underscore " to break up the string and multiple lines.

The following code reveals the examples of the break up the string and multiple lines.



document.write ("The statements are very long" &

"that need to be placed onto four " &

"lines in order to be readable!")



Result:

The statements are very long that the need to be placed onto four lines in order to be readable!

5. Source Code

VBScript contains various codes such as Variables, Constants, and Data Types to perform various function.

VBScript Variables

Variables code are "containers" used to store information. However, VBScript Variables are similar to variables being used in Visual Basic. In the case of VBScript, it is necessary to use Dim Statement to declare a variable. Example of VBScript Variable is as follows:







Dim firstname="Tony"

response.write (firstname)

response.write ("")

firstname="Helen"

response.write (firstname)

The script statement written above declares a variable, displays the value as well as assign a value to it. Furthermore, it changes its value, and displays its value again.





Result

Tony

Helen

The script statement written above declares a variable, displays the value as well as assign a value to it. Furthermore, it changes its value, and displays its value again.

The code below also reveals the strategy to insert variable within a text.







Dim name="Alan Peter"

response.write ("His name is: " & name)





Result

His name is: Alan Peter

Creating an array

In the variable, array can be used to store data items. The following variable code reveals how to use array to store names.







Dim famname (5)

famname (0)="David Richard"

famname (1)="Allen"

famname (2)="Billy"

famname (3)="Peter"

famname (4)="Jim Anderson"

famname (5)=" Tony"

For i=0 To 5

response.write (famname (i) & "")

Ne-xt



Result:

David Richard

Allen

Billy

Peter

Jim Anderson

Tony

VBScript Constants

Constant refers to memory location that is used to hold value. However, Constant cannot when executing the script and if there is an attempt to change the Constant Value, the Variable execution will display an error. The Constant syntax can be Private or Public. Although, the Private or Public is optional nevertheless, Public constant can be found in all procedures and scripts.

Stuck Writing Your "Various Applications and Program Implementation of VBScript" Research Proposal?

It is also possible to assign Date or String to a declared Constant.

VBScript Constants Code

The example below reveals that the value of pi is 4.14, which displays the area of a circle.









Dim intRadius

intRadius = 30

const pi=4.14

Area = pi*intRadius*intRadius

Msgbox Area







Results

VBScript Data Types

VBScript consists of only one data type namely Variant, and Variant serves as the only data type found in the VBScript, and Variant can consist of string or numeric. The following code is an example of VBScript Data Types.

Dim MyVariant

MyVariant = 41

MyVariant = "Big World"

The table below provides the available VBScript Data Types

Data Type

Coercion Function

Test Function

TypeName () return value

VarType () return value

Empty

n/a

IsEmpty ()

Empty

0 (vbEmpty)

Null

n/a

IsNull ()

Null

1 (vbNull)

Integer

CInt ()

isNumeric ()

Integer

2 (vbInteger)

Long

CLng ()

isNumeric ()

Long

3 (vbLong)

Single

CSng ()

isNumeric ()

Single

4 (vbSingle)

Double

CDbl ()

isNumeric ()

Double

5 (vbDouble)

Currency

CCur ()

isNumeric ()

Currency

6 (vbCurrency)

CDate ()

isDate ()

7 (vbDate)

String

CStr ()

n/a

String

8 (vbString)

Object

n/a

isObject ()

Object

9 (vbObject)

Error

n/a

n/a

Error

10 (vbError)

Boolean

CBool ()

n/a

Boolean

11 (vbBoolean)

Variant

CVar ()

n/a

Variant

12 (vbVariant)

Decimal

n/a

isNumeric ()

Decimal

14 (vbDecimal)

Byte

CByte ()

isNumeric ()

Byte

17 (vbByte)

Array

n/a

isArray ()

Array

8192 (vbArray)

VBScript Input Methods, VBScript Output Methods

VBScript Output serves a critical tool for programmer. Four different methods are available to display VBScript Output:

Echo (): This displays message within the Windows Console and the VBScript execution hosts process the output.

Popup (): This display text message using the popup dialogs.

InputBox (): The option reveals text entry field to collect the user input.

MsgBox ():This option also displays text message using the popup dialogs.

VBScript Input is a command to retrieve text from an output program.

Sample VBScript Input Code is as follows:

strUserInput = GetUserInput ( "Please input your first name:" )

WScript.Echo "Your first name is: " & strUserInput

Result

Please input your first name

OK

VBScript Decision-Making Statements

Decision making assist programmers to modify the execution flow within the scripts. The execution can be governed using one or more conditional statements. The diagram below illustrates the condition statements.

Following is the general form of a typical decision making structure found in most of the programming languages:

If statement - executes a program if a condition is true

If...Then...Else statement - select one of the two sets of lines in order to execute

If...Then...ElseIf statement - select one from many sets of lines in order to execute

Select Case statement - select one from many sets of lines in order to execute

Example of If...Then...Else is as follows:







i=hour (time)

If I < 12 Then response.write ("Good afternoon!")

Else response.write ("Good day!")

End If





Result

Good day

VBScript Loop Structures and Arrays

Looping statements are used in order to run the same block of code within a specific number of times.

The VBScript looping statements are as follows:

For...Next statement - runs a code for specific number of times

For Each...Next statement - runs a code for each element or item of an array

Do...Loop statement - loops until or while a condition is correct

While...Wend statement - Do not use this VBScript looping. It is advisable to use the Do...Loop statement.

Example of code of Looping statements are revealed below:







For I = 0 To 6

response.write ("The number is " & I & "")

Ne-xt



Result

VBScript Procedures and Functions

VBScript has two types of procedures:

Sub-procedure

Function procedure

VBScript Sub-Procedures

A sub-procedure is a series of statements that is enclosed by the End Sub-statements and Sub-statements. A sub-procedure can also take arguments. Example of procedure is as follows:







Sub-mysub ()

response.write ("The code is written using the sub-procedure")

End Sub-response.write ("It was written with the script")

Call mysub ()





Result

It was written with the script

The code is written using the sub-procedure

Example of function is as follows:



Function myAdd (x, y)

myAdd = x + y

End Function

'Let's use our function!

Dim result = myAdd (12,16)

document.write (result)



Result

28

VBScript File Output /….....

Show More ⇣


     Open the full completed essay and source list


OR

     Order a one-of-a-kind custom essay on this topic


sample essay writing service

Cite This Resource:

Latest APA Format (6th edition)

Copy Reference
"Various Applications And Program Implementation Of VBScript" (2015, May 30) Retrieved June 13, 2026, from
https://www.aceyourpaper.com/essays/various-applications-program-implementation-2150861

Latest MLA Format (8th edition)

Copy Reference
"Various Applications And Program Implementation Of VBScript" 30 May 2015. Web.13 June. 2026. <
https://www.aceyourpaper.com/essays/various-applications-program-implementation-2150861>

Latest Chicago Format (16th edition)

Copy Reference
"Various Applications And Program Implementation Of VBScript", 30 May 2015, Accessed.13 June. 2026,
https://www.aceyourpaper.com/essays/various-applications-program-implementation-2150861