VBScript and Networking Systems
VBScript is the scripting language developed by Microsoft to assist web developers to create a dynamic website. Typically, VBScript has unlocked different tools that include web server, assessing web server, ability to print date and time. More importantly, the VBScript assists web ASP (Active Server Pages) developers to understand the sophisticated ASP programming language. On the other hand, computer network is a data telecommunication network that allows data exchange across the network systems.
Objective of this paper is to discuss the VBScript and networking.
and Loop Structures
VBScript decision-making assists VBScript programmer to edit the execution flow with the assistance of scripts. If statement assists the VBScript to carry out Decision-Making process and the If statements, include:
IfThen
IfThenElse
ElseIf
If statement is a Boolean expression that is followed by one or two or more statements. For example, if a condition is true, the statements within If condition(s) are executed. However, if the Condition is false, the program executes statements after If loop.
VBScript syntax of If statement is as follows:
If (boolean_expression) Then
Statement 1
Statement n
End If
Example of VBScript program If statement is as follows:
<ody>
The result of above code is:
b is Greater than c
IfThenElse
This statement assists in doing one task if the condition is affirmative or true, however, a user can do another task if the condition or issue is false.
The VBScript syntax of IfThenElse statement is:
If (boolean_expression) Then
Statement 1
Statement n
Else
Statement 1
Statement n
End If
Example of VBScript program of If..then ..else statement is as follows:
<ody>
The result of the above code is:
c is Greater
Else if Statement
Else if statement assists a programmer to execute many expressions.
VBScript Syntax of an ElseIf statement is:
If (boolean_expression) Then
Statement 1
Statement n
ElseIf (boolean_expression) Then
Statement 1
Statement n
ElseIf (boolean_expression) Then
Statement 1
Statement n
Else
Statement 1
Statement n
End If
Example
<ody>
The result of the above code is:
a is equal to NEGATIVE Number
Loop Structure
Loop structure assists a programmer to execute a block of program several times. For example, the first statement is executed followed by the second statement. In other word, in executing a statement multiple times. For example for loop carries out a repetition of control structure which allows developers to execute a statement specific number of times.
The VBScript syntax for loop is:
For counter = start To end [Step count]
[statement 1]
[statement 2
[statement n]
[Exit For]
[statement 11]
[statement 22
[statement n]
Ne-xt
Example of VBScript program for loop is:
<ody>
The result of the above code is:
The value is I is: 0
The value is I is: 3
The value is I is: 6
The value is I is: 9
The value is I is: 12
2. VBScript Procedures and User-Defined Functions
A Function serves as a reusable code that can be called anywhere within a program. The advantage of Function is that it eliminates the needs to write a program over and over again. Moreover, Functions assist programmer to divide a big program in a manageable form.
Functions can be used with the Call keyword. For example, the following program uses the Call Function program:
<ody>
Procedures
VBScript has two types of procedures:
Sub-procedure
Function procedure
A Sub-procedure is a series of VBScript statements that is enclosed by the Sub-as well as End Sub-statements. An advantage of Procedure is that it can take argument and perform actions. Functions are similar to Sub-procedures however; the difference between the two is that Functions may return value while Sub-procedure may not return values.
3. Discussion of and User input
VBScript user input serves as a command to retrieve texts: A sample VBScript user input Code is as follows:
StrUserInput = GetUserInput ( “Please input your surname:” )
WScript.Echo “Your surname name is: ” & strUserInput
Result
Please input your surname
OK
VBScript displays information for users using different methods:
Echo (): The method displays message within the program Windows Console
Popup (): This method displays text message with the popup dialogs.
InputBox (): The option displays the text entry field in order to .
MsgBox (): This method also displays text message by using the popup dialogs.
4. Networked PCs
Basic components to set up a network system are:
Internet Service Provider
A networking software
Personal Computer
A server or router/hub to connect wired or wireless
Establish network-using Wireless PC
The procedure to connect PC to network is a follows:
1. Turn on the PC.
2. Connect to Wi Fi
3. Go to the name of your computer at Wi-Fi icon
4. Click Connect
Add wired PC to establish network
Plug the PC into a router or hub, or switch.
Next, turn it on.
The connection will be established.