vbscript examples

Alibabacloud.com offers a wide variety of articles about vbscript examples, easily find your vbscript examples information here online.

VBS Tutorial: VBscript statement-Execute statement

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,

Quick query of VBScript syntax and instance description

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

VBScript calls FSO

function GetVersion (strpath)Dim Fver, FSOSet fso = CreateObject ("Scripting.FileSystemObject")Fver = fso. GetFileVersion (strpath)Getversion=fverEnd FunctionSub Saveresult (STROUTPATH,STR)Dim Fver, FSOOn Error Resume NextSet fso = CreateObject ("Scripting.FileSystemObject")Set fileobj = Fso.opentextfile (stroutpath+ "\\version.xml", 2,true) ' Write to object using FSO creation fileFileobj.write Str ' writes data to a file, overwriting form writesFileobj.close ' push content writes and closes th

VBScript escape characters

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

Vbs Tutorial: VBScript statement-const statement

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

Vbs Tutorial: VBScript object

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

Vbs Tutorial: VBScript attributes-helpfile attributes

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

Microsoft VBScript compiler error '800a03f6'

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

Microsoft VBScript runtime error

Microsoft VBScript run-time Error (0X800A005E)Invalid use Null: ' Split ' Dim jzid,jzname,jzsm,jzpicurl,jzdata,jzq If RS ("jzdata") = "" or RS ("jzdata") = "0| | | 0| | | 0| | | 0| | | 0| | | 0| | | 0| | | 0| | | 0| | | 0| | | "Then '" to "Jzdata" to "" "Response.Write "To work hard Oh!" You don't have any medals for the moment! "Rs.closeElseJzdata=split (RS ("Jzdata"), "| | |")For i=0 to UBound (jzdata)-1Jzq=jzdata (i)If jzqSet Jzrs=conn.execute ("

3.VBScript Foundation

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

VBScript Learning notes-arrays

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

Summary of usage of On Error statement in VBScript

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

VBScript Tutorial Lesson Eighth use looping statements _vbs

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.

In ASP, a random number class _asp class that is written in VBScript

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 scripts to modify the contents of a file, this applies to automated operations _vbs

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

ASP classic include file (ADO for VBScript)

'-------------------------------------------------------------------- ' Microsoft ADO ' ' Copyright (c) 1996-1998 Microsoft Corporation. ' ' ' ' ADO constants include file for VBScript ' '-------------------------------------------------------------------- '----CursorTypeEnum Values---- Const adopenforwardonly = 0 Const adOpenKeyset = 1 Const adopendynamic = 2 Const adOpenStatic = 3 '----CursorOptionEnum Values---- Const adholdrecords = h00000100 Cons

Design of VBscript class (II.)

Busy looking for a job until the weekend is free. Now to continue the design of our VBScript class. We've designed a simple date class the last time, but there are some On the issue. Now we're going to change our design for these issues. The problem we have to solve this time is: 1, if the user specified classdate is not a date type, then the date will become January 1, 1900; 2. If more than one date is displayed, the name of the form object cannot be

VBScript Tutorial six-looping statements

Using Loop statements 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. Whil

VBS Tutorial: VBScript Properties-description Properties _vbs

Description Property Returns or sets a descriptive string associated with the error. object.Description [= stringexpression] Parameters Object The Err object. stringexpression A string expression containing the error description. Description The Description property contains a short description of the error. This property is used to prompt the user for errors that you cannot or do not want to handle. When a user-defined error is generated, the brief description of this error is assigned

VBS Tutorial: VBScript Properties-helpfile Properties _vbs

HelpFile Property Sets or returns the full valid path of the Help file. object.HelpFile [= contextID] Parameters Object Required option. The Err object. ContextID Options available. The full valid path of the Help file. Description If you specify a Help file in HelpFile , the file is called automatically when the user clicks the Help button (or presses the F1 key) in the error message dialog box. If the HelpContext property contains a valid context ID for the specified file, the topic is automat

Total Pages: 15 1 .... 11 12 13 14 15 Go to: Go

Contact Us

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.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.