1. function Array ()
Function: Create an array variable
Format: Array (list)
Parameters: List of each numeric column in an array variable, separated by a comma
Example:
<% i = Array ("1", "2", "3")%>
Result: I was given an array
2. function CInt ()
Function: Converts an expression/other type of variable to an integer type (int)
Format: Cint (expression)
Parameter: expression is any valid expression/other type of variable
Example:
<%
F = "234"
Response.Write CINT (f) + 2
%>
Results: 236
function CInt () converts the character "234" to an integer 234. If the expression is empty or invalid, the return value is 0;
3. Function: Creatobject ()
Function: Creates and returns an ActiveX object.
Format: Creatobject (obname)
Parameter bname is the name of the object
Example:
<%
Set con = Server.CreateObject ("ADODB.") Connection ")
%>
Results:
4. Function CStr ()
Function: Converts an expression/other type of variable to a character type (string)
Format: Cstr (expression)
Parameter: expression is any valid expression/other type of variable
Example:
<%
s = 3 + 2
Response.Write "The result is:" & CStr (s)
%>
Result: the function CStr () converts the integer 5 to the character "5".
5. Function Date ()
Function: Returns the date of the current system (server side)
Format: Date ()
Parameters: None
Example <% date ()%>
Result: 05/10/00
6. function DateAdd ()
Function: Calculates a specified time and
Format: DateAdd (timeinterval,number,date)
Parameters: TimeInterval is the time unit (month, day ...); Number is the time interval value, date is the point of origin.
Example:
<%
currentdate = #8/4/99#
Newdate = DateAdd ("M", 3,currentdate)
Response.Write Newdate
%> <%
currentdate = #12:34:45 pm#
Newdate = DATEADD ("h", 3,currentdate)
Response.Write Newdate
%>
Results:
11/4/99
3:34:45 PM
which
"M" = "month";
"D" = "Day";
If the format is currentdate, the
"H" = "Hour";
"S" = "second";
7. Function DateDiff ()
Function: Calculates a specified time difference for a quantity
Format: DateDiff (Timeinterval,date1,date2[,firstdayofweek[,firstdayofyear]])
Parameters: TimeInterval is a time unit; Date1,date2 is a valid date expression, Firstdayofweek,firstdayofyear is any option.
Example:
<%
FromDate = #8/4/99#
ToDate = #1/1/2000#
Response.Write "There are" & _
DateDiff ("D", Fromdate,todate) & _
"Millenium from 8/4/99."
%>
Results: There are to millenium from 8/4/99.
8. Function Day ()
Function: Returns an integer value that corresponds to a day of the month
Format: Day (date)
Parameter: date is a valid datetime expression;
Example <% =date (#8/4/99#)%>
Results: 4
9. Function FormatCurrency ()
Functions: Converting to currency format
Format: formatcurrency (expression [, digit[,leadingdigit[,paren[,groupdigit]]]
Parameter: expression is a valid numeric expression; digit represents the number of digits after the decimal point; Leadingdigit,paren,groupdigit is any option.
Example <%=formatcurrency (34.3456)%>
Result 34.35
10. function FormatDateTime ()
Features: Formatting date expressions/variables
Format: FormatDateTime (Date[,nameformat])
Parameter: Date is a valid day expression/variable; NameFormat is the specified date format constant name.
Example <% =formatdatetime ("08/04/99", vbLongDate)%>
Results: Wednesday,august 04,1999
Description
--------------------------------------------------------------------------------
Describe
Returns an expression that has been formatted as a date or time.
Grammar
FormatDateTime (date[, NamedFormat])
The syntax for the FormatDateTime function has the following parameters:
Parameter description
Date required option. The date expression to be formatted.
NamedFormat can be selected. Indicates the value of the date/time format used, and if omitted, uses Vbgeneraldate.
Set up
The NamedFormat parameter can have the following values:
Constant numerical description
Vbgeneraldate 0 Displays the date and/or time. If there is a date part, the section is displayed as a short date format. If there is a time section, the section is displayed in a long time format. If all exist, all parts are displayed.
vbLongDate 1 Displays a date using the long date format specified in the computer locale.
Vbshortdate 2 displays a date using the short date format specified in the computer locale.
Vblongtime 3 Displays the time using the time format specified in the computer locale.
vbShortTime 4 Displays the time using a 24-hour format (hh:mm).
Description
The following example uses the FormatDateTime function to format an expression as a long date and assigns it to Mydatetime:
Function getcurrentdate
The FormatDateTime formats the date type as a long date type.
Getcurrentdate = FormatDateTime (Date, 1)
End Function
--------------------------------------------------------------------------------
11. Function IsNumeric ()
Function: Returns a Boolean value that determines whether a variable is a numeric variable or another variable that can be converted to a number.
Format: isnumeric (expression)
Parameter: expression is any variable.
Example:
<%
i= "234"
Response.Write IsNumeric (i)
%>
Result: true.
12. Function IsObject ()
Function: Returns a Boolean value that determines whether a variable is an object,
Format: isobject (expression)
Parameter: expression is any variable.
Example:
<%
Set con =server.creatobject ("adodb.connection")
Response.Write IsObject (Con)
%>
Result: True
13. Function: Lbound ()
Function: Returns the lower bound of an array.
Format: Lbound (Arrayname[,dimension])
Parameter: Arrayname is an array variable, dimension is any item
Example:
<%
i = Array ("1", "2", "3")
Response.Write LBound (i)
%>
Results: 0
14. Function LCase ()
Function: Converts the character of a character type variable to all lowercase characters.
Format: Lcase (String)
Parameters: string is a literal variable
Example:
<%
Str= "This is lcase!"
Response.Write Lcase (str)
%>
Result: This is lcase!
15. Function Left ()
Function: Intercepts the front part of a string;
Format: Left (string,length)
Parameters: string strings, length intercept lengths.
Example: <% =left ("This is a test!", 6)%>
Result: this I
16. Function Len ()
Function: Returns the length of the string or the byte length of the variable
Format: Len (string *varname)
Parameters: string strings; varname arbitrary variable names
Example:
<%
Strtest= "This is a test!"
Response.Write Left (strtest)
%>
Results: 15
17. Function LTrim ()
Function: Remove the space before the string.
Format: LTrim (String)
Parameters: String Strings.
Example: <% =ltrim ("This is a test!")
Result: This is a test!
18. function Mid ()
Function: Intercepts a string from a string.
Format: Mid (String,start [, length])
Parameters: String string, the beginning of the start intercept, length to intercept.
Example:
<%
Strtest= "This are a test, today is monday!"
Response.Write Mid (strtest,17,5)
%>
Result: Today
19. Function minute ()
Function: Returns a value that represents the minute
Format: Minute (time)
Parameters: Time is a variable
Example lt;% =minute (#12:23:34#)%>
Results: 23
20. Function month ()
Function: Returns a value indicating the month
Format: Month (time)
Parameters: Time is a date variable
Example <% =month (#08/09/99)%>
Results: 9
21. Function MonthName ()
Function: Returns the string (name) of the month.
Format: MonthName (date [, ABB])
Parameter: Date is the abb=true of the month,
Example:
<% =monthname (#4/5/99#)%>
Result: April
22. Function Now ()
Function: Returns the current time and date of the system.
Format: Now ()
Parameters: None
Example:
<% =now ()%>
Results: 05/10/00 8:45:32 pm
23. Function: Replace ()
Function: Finds in a string, substituting the specified string.
Format: replace (Strtobesearched,strsearchfor,strreplacewith [, Start[,count[,compare]]])
Parameter: strtobesearched is a string; strSearchFor is the substring being looked for; strReplaceWith is the substring to be substituted. Start,count,compare is any option.
Example:
<%
Strtest= "This is an apple."
Response.Write Replace (strtest, "Apple", "orange")
%>
Result: This is an orange.
24. Function Right ()
Function: Intercepts the back part of a string
Format: Right (string,length)
Parameters: string strings, length intercept lengths.
Example:
<%
Strtest= "This is a test!"
Response.Write Right (strtest,3)
%>
Result: st!
25. Function Rnd ()
Function: Returns a random value
Format: rnd[(number)]
Parameter: number is any value.
Example:
<%
Randomize ()
Response.Write Rnd ()
%>
Results: One of the 0/1 values, no randomize (), can not produce random numbers.
26. Function round ()
Function: Full value
Format: Round (Expression[,numright])
Parameters: expression numeric expression; numright any option.
Example:
<%
i=12.33654
Response.Write Round (i)
%>
Results: 12
27. Function RTrim ()
Function: Remove the space after the string.
Format: RTrim (String)
Parameters: string is a literal
Example:
<%
Response.Write RTrim ("This is a test!")
%>
Result: This is a test!
28. Function second ()
Function: Returns an integer value.
Format: Second (time)
Parameter: Time is a valid temporal expression;
Example lt;% =second (# 12:28:30#)%>
Results: 30
29. Function StrReverse ()
Function: Returns a string that is in reverse order from the original string.
Format: StrReverse (String)
Parameters: string is a literal
Example <% =strreverse ("This is a test!")
Result:!tset a Si siht
30. Function Time ()
Function: Returns the time value of the current system.
Format: Time ()
Parameters: None
Result: 9:58:28 Am
31. Function Trim ()
Function: Delete the string before, after the space.
Format: Trim (String)
Parameters: String Strings.
Example:
<%
Strtest= ' This is a test! ”
Response.Write Trim (strtest)
%>
Result: This is a test!
32. Function UBound ()
Function: Returns an upper bound of an array.
Format: Ubound (expression [, dimension])
Parameters: expression is an array expression/array variable, dimension is any item
Example:
<%
i = Array ("1", "2", "3")
Response.Write UBound (i)
%>
Results: 2
33. Function: UCase ()
Function: Converts the character of a character type variable to uppercase characters.
Format: Ucase (String)
Parameters: string is a literal variable
Example:
<%
Str= "This is lcase!"
Response.Write Lcase (str)
%>
Result: This is lcase!
34. Function VarType ()
Function: Returns the constant code of a variable (integer)
Format: Vartype (varname)
Parameter: varname is a variable name of any type.
Example:
<%
I=5
Response.Write VarType (i)
%>
Results: 2 (2 for integers, need to refer to ASP constant code.)
35. Function Weekday ()
Function: Returns an integer that corresponds to the day ordinal of a week.
Format: Weekday (date [, Firstofweek])
Parameter: Date is a day variable and Firstofweek is an optional option.
Example:
<%
d= # 5/9/00 #
Response.Write Weekday (d)%>
Results: 3 (3 indicates Tuesday)
36. Function WeekdayName ()
Function: Returns a string that corresponds to the day of the week.
Format: WeekdayName (Weekday[,abb[,firstdayofweek]])
Parameters: Weekday is a date variable and abb,firstdayofweek is an optional option.
Example:
<%
D = #8/4/99#
Response.Write WeekdayName (d)
%>
Result: Wednesday
37. Function year ()
Function: Returns the year in which the date expression is located.
Format: Year (date)
Parameter: Date is a valid day expression
Example:
<% =year (#8/9/99#)%>
Results: 1999
38. Function mod () function: Take remainder.
Example: 3 Mod 2
Results: 1
Function name function
Convert CBool (String) to a Boolean value
CByte (String) to a value of byte type
Ccur (string) converted to currency class value
Cdate (String) to a value of the date type
Convert Cdbl (string) to double values
Convert Cint (string) to integer values
CLNG (String) to a value of a long integer
CSng (String) to a single-precision value
Cstr (Var) conversion to String value
The STR (Var) numeric value is converted to a string
Val (String) string converted to numeric value
****** ******
****** ******
Abs (NMB) returns the absolute value of a number of children
ATN (NMB) returns the tangent of a number
Cos (NMB) returns the dazzle value of an angle
EXP (NMB) returns the secondary value of the natural exponent
INT (NMB) returns the Shaping (rounding) of a number
Fix (NMB) returns the number of plastic (shed) parts
FormatPercent (expression) return percent
Hex (NMB) returns the number of 16 in the data
Log (NMB) returns the natural logarithm
OCT (NMB) returns the number of 8 numbers
Rnd returns a random number greater than "0" and less than "1"
SGN (NMB) determines the positive and negative number of a number
Sin (NMB) returns the positive-hyun value of the angle
SQR (NMB) returns the two square root of the number
Tan (NMB) returns the tangent of a number
ASC (String) returns an ASCII string
CHR (CharCode) returns characters based on character codes
INSTR (STRING,SEARCHSTR) returns the first character position of the searched string, string, and searchstr is the searched string
InStrRev (STRING,SEARCHSTR) ditto, just start the search from the right
Lcase (Var) turns a string to lowercase
Left (STRING,NMB) returns a NMB string starting from a string
Len (String) returns the length of the string
Ltrim (String) truncate the space to the left of the string
Filter (Inputstrings,value) returns a string array of words, Inputstrings is a string group, and value is the character found in the array
Rtrim (String) truncate the space to the right of the string
Trim (String) to truncate a space before and after a string
Mid (String,start,len) returns the Len character from the start position in string
Replace (STRING,FIND,WITHSTR) in string strings, replacing the find string with Withstr
Right (STRING,NMB) returns a NMB string from the right starting from a string
Space (NMB) returns a string of specified spaces
StrComp (string1,string2) compares two strings
Ucase (string) to uppercase
Common commands:
Rs.movenext ' Moves the record pointer down one row from the current position
Rs.moveprevious ' Moves the record pointer up one row from the current position
Rs.movefirst ' Move the record pointer to the first row of the datasheet
Rs.movelast ' Move the record pointer to the last row of the datasheet
CurrentPage ' first few pages
Rs.absoluteposition=n ' Move the record pointer to the nth row of the datasheet
Rs.absolutepage=n ' Move the record pointer to the first row of page N
Rs.pagesize=n ' Set every page to N records
Rs.pagecount ' Returns the total number of pages according to the pagesize settings
Rs.recordcount ' Returns the total number of records
Rs.bof ' Returns whether the record pointer exceeds the first end of the datasheet, true to Yes, false to No
Rs.eof ' Returns whether the record pointer is out of the end of the datasheet, True indicates Yes, FALSE is no
Rs.delete ' Deletes the current record, but the record pointer does not move down
Rs.addnew ' Add record to data table end
Rs.update ' Update datasheet record