VBScript functions
Function description
Example
Abs (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: the 2000 Array (an Array element separated by commas) Array function returns the value of an Array element. Example:
A = Array (1, 2, 3)
B = A (2)
Result: 2
Note: variable B is the value of the second element of array.
Asc (string) converts the first letter of the string into an ANSI (American National Standard) character code. Example: Asc ("Internet ")
Result: 73
Description: displays the ANSI code of the first letter I.
Example: CBool (1 + 2)
Result: the value of True CDate (date expression) is changed to the date variable type. You can use the IsDate function to determine whether the data can be converted to a date. Example: CDate (now () + 2)
Result: the expression CDbl (expression) is converted to the DOUBLE variable type at 10:30:59 on February 28. Chr (ANSI code) converts ASCII code into characters. Example: Chr (72)
Result: H CInt (expression) is converted to an integer variable type. Example: CInt ("3.12 ")
Result: 3 CLng (expression) is converted to the LONG variable type. CSng (expression) is converted to the SINGLE variable type. CStr (expression) is converted into a string variable type. Date () returns the Date of the system. Example: Date
Result: DateAdd (I, N, D) adds a date with the date after a period.
I: set the unit of a period added by a Date. For example, interval = "d" indicates that the unit of N is day.
I is set as follows:
Yyyy Year
Q Quarter
M Month
D Day
W Weekday
H Hour
N Minute points
S Second seconds
N: a numeric expression that specifies the period of a date. It can be a positive or negative value. A positive value indicates a plus (the result is a date after date ), negative value indicates subtraction (Result:> date before date ).
D: date to be added or subtracted. Example: DateAdd ("m", 1, "31-Jan-98 ")
Result: 28-Feb-98
Note: If the date is 31-Jan-98 plus one month, the result is 28-Feb-98 rather than 31-Fe-98.
Example: DateAdd ("d", 20, "30-Jan-99 ")
Result:
Note: add a date of 30-Jan-99 plus a date of 20 days. DateDiff (I, D1, D2 [, FW [, FY]) calculates the period between two dates.
I: set the unit of period calculation between two dates. For example, I = "m" indicates that the unit of calculation is month.
> The set value of I is as follows:
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