Various Applications And Program Implementation Of VBScript Research Proposal

Length: 5 pages Subject: Education - Computers Type: Research Proposal Paper: #39362945 Related Topics: College Application, College Admission, Microsoft Windows, Broken Windows
Excerpt from Research Proposal :

¶ … 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. 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...

...

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 /…

Cite this Document:

"Various Applications And Program Implementation Of VBScript" (2015, May 30) Retrieved January 27, 2022, from
https://www.paperdue.com/essay/various-applications-and-program-implementation-2150861

"Various Applications And Program Implementation Of VBScript" 30 May 2015. Web.27 January. 2022. <
https://www.paperdue.com/essay/various-applications-and-program-implementation-2150861>

"Various Applications And Program Implementation Of VBScript", 30 May 2015, Accessed.27 January. 2022,
https://www.paperdue.com/essay/various-applications-and-program-implementation-2150861

Related Documents
Syntax Analysis There Is Conflict
Words: 948 Length: 3 Pages Topic: Communication - Language Paper #: 76553811

They left that, as they said, to 'future research', but as yet no future research seemingly has been done on that subject. This is the contribution of this study. Research Objective The first step is to replicate Dulay & Burt's (1973) previous study. Times have changed. The educational system has changed. Our aim will be to test whether the 12% of syntactic errors are indeed unique, or whether their appearance is due

Polish Syntax Introduction to the
Words: 3157 Length: 10 Pages Topic: Communication - Language Paper #: 83621326

In colloquial Polish speech, hyperbaton is associated with strong focus, optimally with symmetrical contrast. However, in literary prose hyperbaton can also occur with weak focus and with unfocused nonlexicals. When presented with examples of the exclusively literary type of hyperbaton out of their literary context, native speakers of Polish either rejected them say-ing that they did not understand why the Y1 modifiers were in hyperbaton, or corrected them into colloquially

Acquisition of Syntax by Children
Words: 870 Length: 3 Pages Topic: Communication - Language Paper #: 62641020

, 2007, p. 314). Although it seems rather complex, Chomsky's innateness hypothesis is perhaps the most easily obtained explanation of children's ability to learn a language. Human beings are programmed with a whole host of cognitive abilities when they are born. We have the instinct to suck, learn how to walk without necessarily being taught, and can think without lessons in how to do so, although we may need training or

How to Teach Syntax to ELLs
Words: 708 Length: 2 Pages Topic: Languages Paper #: 48388043

Linguistics Application and Reflection: Challenges of English Syntax Passive voice: 1) "We are governed by men we have never heard of." 2) "We are given a set of tools to work with." 3) "The audience is driven by the images on the screen." Comparatives: 1) "The more it appears on signs, the more it is accepted as normal." 2) "No one believes things are so good that they could not be better." Logical

Energy Sources of the Future
Words: 1280 Length: 3 Pages Topic: Communication - Language Paper #: 24357764

Instead of analyzing the innate meaning of these examples using a structured technique, Chomsky argues that it is only through subconscious knowledge of transformational grammar that one can truly understand the deeper meaning of language. Of course, this theory has been challenged by many with its emphasis on syntax and lack of focus on semantics, but as Chomsky himself said: But the fundamental reason for [the] inadequacy of traditional grammars is

Second Language Acquisition Through Child's
Words: 627 Length: 2 Pages Topic: Communication - Language Paper #: 24538922

The illustrations found within the pages of Dr. Seuss stories are also an attention grabber which help keep students focused and tie into the lessons of prepositions and vocabulary. Another simple yet effective method of teaching English to ESL students is to utilize game playing strategies. Games are used in learning since birth, and for adults and kids alike, it is the best way to incorporate all the students together