In vbscript statements, " H" is used for hexadecimal representation. When the '' symbol is used for string connection, a space should be added to both sides. Although it is normal to run normally without a space, but that is an incorrect or nonstandard way of writing. When a field starting with the letter "h" appears, such a statement is available:
SQL = "insert into Student (xxx, xxx) values ('" htitle "', '" hname "')"
The "statement is not c
Use loop statements
Loop is used to repeatedly execute a set of statements. Loops can be divided into three types: one type changesFalseExecute the statement repeatedly before.TrueThe statement is executed repeatedly before, and the other type repeats the statement according to the specified number of times.
The following statements can be used in VBScript:
Do... Loop: When (or until) the condition isTrueCycle.
While... Wend: when the condition isT
VBScript statement
Description
Language Element
Give control to oneSubOrFunctionProcess.
Call Statement
Declare the name of a class.
Class statement
The constant used to replace the text value.
Const statement
Declare variables and allocate buckets.
Dim statement
When a condition isTrueOr when a condition changesTrueExecute a statement block again.
Do... Loop statement
Re
Execute statement
Execute one or more specified statements.
Execute statements
RequiredStatementsA parameter is a string expression that contains one or more statements to be executed. If you wantStatementsThe parameter contains multiple statements, which should be separated by semicolons or embedded branches.Description
In VBScript,X = yThere are two possible interpretations. First, as the value assignment statementYValueX. Second, as an expression,
VBScript Functions
Function DescriptionExampleAbs (numerical value) absolute value. The absolute value of a number is its positive value. The absolute value of a null string. The uninitialized variable is definitely 0. Example: ABS (-2000)Result: 2000
Array (an Array element separated by commas) the Array function returns the value of an Array element. Example:A = Array (1, 2, 3)B = A (2)Result: 2Note: Variable B is the value of the second element of
The Escape Character of C ++ is :\
The Escape Character of VBScript is: "(double quotation marks)
Example: response. Write (" ")
Note that the double quotation marks on the red background indicate escape characters. If we omit them, the entire statement will fail and the escape characters will not be output. The output in the above example is:
Why can't it be omitted? If we omit it, the above sentence becomes: Response. Write (" ")
Because doubl
methodPublicOrPrivateKeyword, the keyword is valid for all constants in the row.
Variable, user-defined function, or VBScript internal function (suchCHR). By definition, they cannot be constants. In addition, you cannot create constants from expressions that contain operators. That is, you can only use simple constants. InSubOrFunctionThe constant declared in the process is the local constant of the process. The constant declared outside the process
VBScript object
Description
Language Element
Provides access to events of the created class.
Class Object
The object used to save the primary key and value pair of data.
Dictionary object
Contains information related to running errors.
ERR Object
Provides access to computer file systems.
FileSystemObject object
Provides access to read-only attributes matching a
Helpfile attributes
Sets or returns the complete valid path of the Help file.
Object.Helpfile[= Contextid] Parameters
Object
Required.ErrObject.
Contextid
Optional. The complete valid path of the Help file. Description
IfHelpfileWhen the Help file is specified, When you clickHelpThis file is automatically called when you press the button (or press the F1 key. IfHelpcontextIf the attribute contains the valid context ID of the specified file, the topic is automatically displayed. If not
We often encounter such errors when using cms. Below I will make these errors during the use of mobile phones. Let's take a look at the cause analysis and solutions for this problem.Error message:Microsoft VBScript compiler error: '800a03f6'The 'end'/iisHelp/common/500-100.asp is missing, line 242Request object error 'asp 0107: 66661'Stack OverflowD: WWWROOTWZYUYING_COMPOWEREASYADMIN.../Start. asp, row 172The processed data
1.VBS There is only one data type-the variant is similar to a generic type, where specific types are materialized at the time of invocation2. Declaring variables can be used with the Dim statement, public statement, private statementDeclare multiple variables separated by commascan also be implicitly declared, and directly written, but not a good way, not recommended3. Declare the array Dim A (10). Starting from 0.Dynamic arraysDim Answer () Redim Preserve Answer (+)However, when using ReDim to
array so that it is variable in size. First, you do not have to specify the size when declaring an arrayDim VarName ()You can use the ReDim statement to set or reset the size of an array before the first use, and at any time thereafterReDim [Preserve] varname (subscripts) [, ...]The keyword Preserve makes VBScript keep existing data in a resized array. (If the new array is shorter than the original, the extra elements at the end are removed). If ther
The VBScript language provides two statements and an object to handle "Run-time errors", such as the next, 1.On error Resume Next statement, 2.On error Goto 0 statement, 3.Err object, below we will discuss in detail.
If the On Error statement is not used, any run-time error is fatal, that is, the result will cause an error message to be displayed and the operation aborted. A "allowed" error handler is a handler that is opened by the On Error statemen
Repeating code with loops
Loops are used to repeatedly execute a set of statements. Loops can be grouped into three categories: a class that repeats a statement before the condition becomes False, a class that repeats the statement before the condition becomes True, and another class repeats the statement at a specified number of times.
The following looping statements can be used in VBScript:
Do ... Loop: loops when (or until) the condition is True.
Foreigners write a class, such a small application, unless there is a special need, there is no need for modularity.
Generate a random number using ASP.
''**************************************************************************
"' Class:crandom
' Calls randomize to seed the random number generator.
' provides functions for returning ranged random integers or arrays of
' Ranged random integers.
"Calling Randomize to Seed" random number generator at the time the
' class is created seemed like a
Use VBScript script to modify the contents of a file, this applies to automated operations
' Create a new Replace.vbs script, the script reads as follows, when the program runs, enter three parameters: Find content, replace content, file
Copy Code code as follows:
Dim FileName, Find, ReplaceWith, FileContents, dfilecontents
Find = wscript.arguments (0)
replacewith = wscript.arguments (1)
FileName = WScript.Arguments (2)
' Read the
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.