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: 2000Array (comma-delimited array element) Array function returns the value of the array element. Example:
A=array (1,2,3)
B=a (2)
Results: 2
Description: Variable B is the value of the second element of array A. ASC (String) Converts the first letter of the string to ANSI (American National standard symbol) codewords. Example: ASC ("Internet")
Results: 73
Description: Displays the ANSI codewords of the first letter I. CBool (expression) conversion to Boolean logical value variable form (TRUE or FALSE) Example: CBool (1+2)
Result: True CDate (date expression) is changed to date variable type. You can use the IsDate function to determine whether a date could be converted. Example: CDate (now () +2)
Results: The 2000/5/28 10:30:59 CDbl (expression) is converted into a double variable type. CHR (ANSI codewords) converts ASCII codewords to characters. Example: Chr (72)
Result: the H CInt (expression) is converted to an integer variable type. Example: CInt ("3.12")
Result: 3 CLng (expression) is converted to a long variable type. The CSng (expression) is converted to a single variable type. The CSTR (expression) is converted to a string variable type. Date () is passed back to the system. Example: Date
Result: 2000/5/13dateadd (I, N, D) adds a date after a period of time. I: Set the unit for a period of time (date). For example, interval= "D" means the unit of n is the day. The setting value of I is as follows:
YYYY year
Q Quarter Season
M Month Month
D Day
W Weekday Week
H Hour Time
N-Minute
S Second sec
N: A numeric expression that sets a period of time added by a date, either positive or negative, positive (the result is >date date), and negative for minus (the result is >date previous date).
D: The date to be added and reduced. Example: DateAdd ("M", 1, "31-jan-98")
Result: 28-feb-98
Note: Add the date 31-jan-98 one months, the result is 28-feb-98 rather than 31-fe-98.
Example: DateAdd ("D", "30-jan-99")
Results: 1999/2/9
Description: Add a date 30-jan-99 20 days after the date. DateDiff (I, D1, D2[,fw[,fy]) calculates the period between two dates.
I: Set the unit of the period calculation between two dates. For example, >i= "m" means the unit of calculation is month. >i setting values are as follows:
yyyy > Year
Q Quarter Season
M Month Month
D Day
W Weekday Week
H Hour Time
M-Minute
S Second sec
D1, D2: Two date expressions in the calculation period, if >date1 earlier, the period result between two dates is positive; if >date2 earlier, the result is negative.
FW: Sets the first day of the week for the week, if not set for Sunday. The set values for >FW are as follows:
0 Use the set value of >api.
1 Sunday
2 Monday
3 Tuesday
4 Wednesday
5 week Four
6 Friday
7 Saturday
FY: Setting the first week of the year, if not set, means that the week of January 1 is the first week of the year. The set values for >fy are as follows:
0 Use the set value of >api.
1 January 1 The week is the first week of the year
2 include at least four days of the first week of the first week of the year
3 includes the first week of seven days as the first week of the Year: DateDiff ("D", "25-mar-99", "30-jun-99")
Results: 97
Description: Displays the period between two dates as 97 days. DatePart (I,d,[,fw[,fy]) returns the part of a date.
>i: Set it back to that part. For example, >i= "D" means to return part of the day. The set values for >i are as follows:
YYYY year
Q Quarter Season
M Month Month
D Day
W Weekday Week
H Hour Time
M-Minute
S Second sec
D: the date to be calculated.
>FW: Set the first day of the week for the weekday, if not set for Sunday. The set values for >FW are as follows:
0 Use the set value of >api.
1 Sunday
2 week one >3 Tuesday
4 Wednesday
5 week Four
6 Friday
7 Saturday
FY: Setting the first week of the year, if not set, means that the week of January 1 is the first week of the year. The set values for >fy are as follows:
0 Use the set value of >api.
1 January 1 The week is the first week of the year
2 include at least four days of the first week of the first week of the year
3 includes the first week of seven days as the first week of the Year: DatePart ("M", "25-mar-99")
Results: 3
Description: Displays the month part that returns a date. Dateserial (year,month,day) conversion (Year,month,day) into a date variable type. Example: DateSerial (99,10,1)
Results: The 1999/10/1datevalue (string or expression of the date) is converted to a date variable type, dated from January 1,100 to December 31,9999. The format is Month,day,and year or month/day/year. For example: December 30,1999, Dec 30,1999, 12/30/1999, 12/30/99 Examples: DateValue ("January 1,2002")
Result: 2002/1/1day (string or expression of the date) returns the "Day" part of the date. Example: Day ("12/1/1999")
Result: 1Fix (expression) converts a string into an integer numeric form. Same as Int function. NULL is returned if NULL.
The difference between Int (number) and Fix (number) is negative. such as Int ( -5.6) =-6, Fix (-5.6) =-5. Example: Fix (5.6)
Result: 5Hex (expression) returns the hexadecimal value of the value. If the expression is null Hex (expression) =null, if the expression =empty Hex (expression) = 0. The 16 carry can be added "&h", for example, the 16 carry &H10 represents the decimal 16. Example: Hex (30)
Result: 1EHour (string or expression of time) returns the "hour" portion of the time. Example: Hour ("12:30:54")
Result: 12InStr ([Start,]string1,string2[,compare]) compares a string from left to right with another, and returns the first same position.
Start is a comparison from the first word, if the start is omitted from the beginning of the comparison, string1 for the string expression to be found, string2 for the string expression to be compared, compare for comparison, compare=0 table binary comparison method, compare =1 Table Text comparison method, if omitted compare is a preset binary comparison method. Example: InStr ("abc123def123", "12")
Result: 4InstrRev ([Start,]string1,string2[,compare]) compares a string from right to left to another and returns to the first same position.
Start is a comparison from the first word, if the start is omitted from the beginning of the comparison, string1 for the string expression to be found, string2 for the string expression to be compared, compare for comparison, compare=0 table binary comparison method, compare =1 Table Text comparison method, if omitted compare is a preset binary comparison method. Example: InStrRev ("abc123def123", "12")
Result: 10Int (expression) returns the integer portion of a number. Same as the Fix function. Example: Int (5.6)
Result: the 5IsArray (variable) test variable is (True) No (False) is an array. Example: IsArray (3)
Result: False
Description: Not an array. Whether the IsDate (an expression of a date or string) can be converted to a date. Date from Ja
[1] [2] Next page