Various Applications And Program Implementation Of VBScript 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 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 =...

...

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 / InputOutput Methods

VBScript file input and output refers to reading and writing to and from files.

Example of Input code is as follows:

' Write to the file.

MyFile.WriteLine "Big world!"

MyFile.WriteLine "The quick white fox"

MyFile.Close

Loop

MyFile.Close

Conclusion

The VBScript is used to develop dynamic web pages for Internet Explorer viewers. The paper reveals various codes to perform VBScript program, which include Variables, Constants, and Data Types. The paper also discusses VBScript Procedures and Functions as well as various condition statements for the VBScript program.

Cite this Document:

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

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

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

Related Documents

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

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

, 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

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

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

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