Because we're going to test a Web project with QTP next week, it took some time tonight to re-learn the VBScript syntax. Just know that VBScript only supports IE browser and is not supported for other browsers.The following is a brief introduction to some syntax:1. VBScript is case-insensitive and supports space, tab, and Space tab blending using the Indent metho
1) function example php: functioninc ($ val) {return $ val + 1;} is also a function, but no return value. Jscript, javascript: functioninc (val) {returnval + 1;} process definition is the same as above. VBScript: functioninc 1) function example
Php: function inc ($ val)
The {return $ val 1;} process is also a function, but there is no return value.
Jscript, javascript:
Function inc (val)
{Return val 1 ;}
The process is defined as above.
What is a VBScript data type?
VBScript has only one data type, called a Variant. A Variant is a special type of data that, depending on how it is used, can contain different categories of information. Because the Variant is the only data type in VBScript, it is also the data type of the return value of all functions in VBScri
What's a good question about which VBScript and JavaScript should be used in many forums?
Today I would like to talk about my opinion:
Server side:
It is known that ASP supports both scripting languages, which is the same on the server side, but most people in the server
End with VBScript more, for beginners generally use VBScript is OK.
Client:
The main popular
Begin:
You can have JavaScript and VBScript implement music from the same table. Look at the following script:
[Ctrl + A All SELECT Note: If the need to introduce external JS need to refresh to perform]
RUNAT:
Let's break it down from beginning to end. The following list is a simple and independent javascript:
If it weren't for the humble runat= "Server," it would look like a simple javascript you might see on the client.
The Runat prop
This article demonstrates several important applications of ASP server-side scripting.
Directory:
1. Traverse the collection/object
1.1 VBScript traverse a collection of forms
1.2 JScript Traverse Form Collection
2, the transformation of the value of variables, and assigned
2.1 VBScript Transition measure value is variable and assigned value
2.2 JScript Transition measure value is variable and assign value
1, VBScript Introduction
VBScript is a scripting language and the default language for ASP, which allows you to embed a VBScript script directly in an HTML file to extend HTML so that it is more than just a page format language. Web pages with VBScript scripts can respond to user actions.
2. Add
applications of arrays, and I think most of them are very familiar with it.
So has anyone ever used it? Examples are as follows:
Dim A (3)
Dim B (4)
A (0) =b
The above code does not error the result is UBound (a (0)) is 4, stating that a (0) is an array. This is like using a one-dimensional array in JS to form a two-dimensional or multidimensional array.
Then modify the above code:
Dim A (2)
Dim B ()
ReDim B (3)
A (0) =b
ReDim B (5)
After the exec
Vbscript|visual
New easy to set (Assignment) syntax
Visual Basic.NET provides new, simplified syntax, when the code is written as follows
Myval = 10
Myval + 10
The value of this myval is 20, and the code is equal to
Myval = Myval + 10
Inherit (inheritance)
Visual Basic.NET is now a complete object-oriented (object Orient) language, which is the way to complete support for encapsulation, inheritance, polymorphism, etc., and to provide construction/Shi
JavaScript: the server VBScript and JScript are written in the same way. Javascript tutorial
Methods of writing VBScript and JScript on the server with the same features
Abstract: This article demonstrates several important applications of ASP server scripts.
1. Traverse collection/Object1.1 VBScript traversal form set
Linenum
For each temp in reque
Anyone who has done industrial control knows that the support for scripting language is a basic function (such as iFIX and Kingview) that standard configuration software should possess ). Can we implement similar functions using VB?We all know that Microsoft provides the Micrsoft script Control 1.0 control, we also saw the use of this control in VB (for example, using the executestatement method to execute the script command executestatement ("msgbox" "")??? ). But most importantly, there is no
Process ClassificationIn VBScript, the process is divided into two types: Sub process and Function process.Sub processThe Sub process is a set of VBScript statements between the Sub and the End Sub statements. The execution operation does not return values. Sub processes can use parameters (constants, variables, or expressions passed by the call process ). If the Sub process has no parameters, the Sub state
VBScript
Vbscript-the Easy Stuff-page 2
Chris Assenza
February 5, 2001
Variables
I am The Everyone knows what a variable is, but to being safe, a variable is a little chunk the memory in which a value of vary The ing type (like characters and numbers) can is stored and manipulated. The is isn't the most precise or technical definition that could being used, but I suspect everyone gets the picture. Vari
vbscript| function |vbscript| function
VBScript functions
Function description
Example
ABS (value) absolute value. The absolute value of a number is its positive value. The absolute value of an empty string (null), also an empty string. Uninitialized variables, which are absolutely 0 examples: ABS (-2000)
Result: 20
to a Web page from a message box." One way to do this is to embed the hyperlinks in a message box, but unfortunately, as we've said above, using VBScript is not a good idea. So let's try something else to see: Why don't you pop up a message box and ask the user: "Do you want to apply for access to this resource?" "Then?" If the user clicks No, the script is aborted. If the user clicks Yes, the script will automatically bring the user to the appropria
VBScript Microsoft Visual basic Scripting Edition is the newest member of the Visual Basic family of program development languages, and it applies flexible Script to a wider range of areas, including Microsoft Inter NET Explorer script and Web server script in Microsoft Internet Information Server.
Easy to learn and easy to use
If you already know Visual Basic or Visual Basic for Applications, you'll soon be familiar with
No way. You need to write some asp files.
Code Depressed. Put a function table for future reference.
VBScript (ASP) common functions:
1. Numeric functions:
ABS (Num): returns the absolute value.SGN (Num): num> 0 1; num = 0 0; num Hex (Num): returns the hexadecimal value for direct representation: hxx maximum 8 bitsOct (Num): returns the octal value and indicates the maximum 8 bits of oxxSqr (Num): returns the square root num> 0INT (Num): in
based on the current time.③ Here we will introduce a fairly good random number generator. Program And can be used in many fields. CopyCode The Code is as follows:
Ii. VBScript (ASP) Random NumberVbs Random Number GenerationA random number with no specified rangeCopy codeThe Code is as follows: function getrandomize (numstr)RandomizeGetrandomize = int (numstr * RND) + 1)End Function
Generate random numbers within a specified rangeCopy codeThe Code
method: Make the Host Object Model Available to the script engine.Eval method: calculates the expression and returns the result.Executestatement method: run the specified statement.Reset method: discard all script code and objects that have been added to scriptcontrol.Run method: run the specified process.EventError Event: This event occurs when a running error occurs.Timeout event: This event occurs when the time specified by the timeout attribute is exceeded and the end is selected in the res
1. Select Add class-MFC class in typelib.2. Select Add from the registry at c: \ windows \ system32 \ VBScript. dll.3. Generate the class file cmatch. h cmatch2.h cmatchcollection. h cmatchcollection2.h cregexp. h cregexp2.hCsubmatches. h4. Set # import "C: \ WINDOWS \ system32 \ VBScript. dll \ 3" no_namespaceChange to # import "progid: VBScript. Regexp" no_name
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.