ASP function
Array () FUNCTION: to return to an array SYNTAX: Array (list) ARGUMENTS: character, figures may EXAMPLE: <%
Dim myArray ()
For i = 1 to 7
Redim Preserve myArray (i)
MyArray (i) = WeekdayName (i)
Next
%> RESULT: the establishment of a seven element contains an array of myArray
MyArray ( "Sunday", "Monday" … … "Saturday") CInt () FUNCTION: an expression into digital type SYNTAX: CInt (expression) ARGUMENTS: characters can be any effective EXAMPLE: < %
F = "234"
Response.write cINT (f) + 2
%> RESULT: 236
Characters into "234" number "234", and if the string is empty, then the return value of 0 CreateObject () FUNCTION: To establish and returns a registered ACTIVEX components examples. SYNTAX: CreateObject (objName) ARGUMENTS: objName is any effective ACTIVEX components registered the name. EXAMPLE: <%
Set con = Server.CreateObject ( "ADODB.Connection")
%> RESULT: CStr () FUNCTION: transforming an expression to a string. SYNTAX: CStr (expression) ARGUMENTS: expression is any valid expression. EXAMPLE: <%
S = 3 + 2
Response.write "The result is:" & cStr (s)
%> RESULT: Transforming number "5" for the character "5." Date () FUNCTION: Back to the current system date. SYNTAX: Date () ARGUMENTS: None. EXAMPLE: <Date%% => RESULT: 8/4/99 DateAdd () FUNCTION: Back was a change in the date. SYNTAX: DateAdd (timeinterval, number, date) ARGUMENTS: timeinterval is the time interval to add; number is amount of time intervals to add; and date is the starting date. 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
%> RESULT: 11/4/99
3:34:45 PM
"M" = "month";
"D" = "day";
If currentDate is in time format then,
"H" = "hour";
"S" = "second"; DateDiff () FUNCTION: Returns the difference between two dates. SYNTAX: DateDiff (timeinterval, date1, date2 [firstdayofweek [firstweekofyear]]) ARGUMENTS: timeinterval said that the time gap between the types, such as "M" for "months." EXAMPLE: <%
FromDate = # # 8/4/99
ToDate = # # 1/1/2000
Response.write "There are" & _
DateDiff ( "d", fromDate, toDate) & _
"Days to millenium from 8/4/99."
%> RESULT: From 8/4/99 to 2000 there are 150 days. Day () FUNCTION: Back to the first few days of the month. SYNTAX: Day (date) ARGUMENTS: any effective date is the date. EXAMPLE: <% = Day (# # 8/4/99)%> RESULT: 4 FormatCurrency () FUNCTION: Back expression, the expression has been formatted for currency values SYNTAX: FormatCurrency (Expression [Digit [LeadingDigit [Paren [GroupDigit ]]]]) ARGUMENTS: Digit right of the decimal point instructions show median values. The default is -1, the use of computer instructions regional settings; LeadingDigit three-state constant, whether the instructions displayed on the front of the decimal point numerical zero. EXAMPLE: <% = FormatCurrency (34.3456%)> RESULT: $ 34.35 FormatDateTime () FUNCTION: Back expression, the expression has been formatted for the date or time SYNTAX: FormatDateTime (Date, [NamedFormat]) ARGUMENTS: NamedFormat direction using the date / time of the numerical format, if omitted, then use vbGeneralDate. EXAMPLE: <% = FormatDateTime ( "08/4/99" vbLongDate)%> RESULT: Wednesday, August 04, 1999 FormatNumber () FUNCTION: Back expression - This expression has been formatted for Numerical. SYNTAX: FormatNumber (Expression [Digit [LeadingDigit [Paren [GroupDigit ]]]]) ARGUMENTS: Digit right of the decimal point instructions show median values. The default is 1, the instructions for using the computer's regional settings. ; LeadingDigit i right of the decimal point instructions show median values. The default is 1, the instructions for using the computer's regional settings. ; Paren right of the decimal point instructions show median values. The default is 1, the instructions for using the computer's regional settings. ; GroupDigit i right of the decimal point instructions show median values. The default is 1, the instructions for using the computer's regional settings. . EXAMPLE: <% = FormatNumber (45.324567, 3)%> RESULT: 45.325 FormatPercent () FUNCTION: Back expression, the expression has been formatted as a% symbol behind the percentage (multiplied by 100). (%) SYNTAX: FormatPercent (Expression [Digit [LeadingDigit [Paren [GroupDigit ]]]]) ARGUMENTS: ditto. EXAMPLE: <% = FormatPercent (0.45267, 3)%> RESULT: 45.267% Hour () FUNCTION : 24 hours to return. SYNTAX: Hour (time) ARGUMENTS: EXAMPLE: <% = Hour (# # 4:45:34 PM)%> RESULT: 16
(Hour has been converted to 24-hour system) Instr () FUNCTION: Back character or string in another string in the first place. SYNTAX: Instr ([start] strToBeSearched, strSearchFor [compare]) ARGUMENTS : Start to search Starting values, strToBeSearched accept strSearchFor search string to search for characters. compare comparative format (for details see constant ASP) EXAMPLE: <%
StrText = "This is a test!"
Pos = Instr (strText, "a")
Response.write pos
%> RESULT: 9 InstrRev () FUNCTION: ditto only from the last search string from SYNTAX: InstrRev ([start] strToBeSearched, strSearchFor [compare]) ARGUMENTS: ditto. EXAMPLE: <%
StrText = "This is a test!"
Pos = InstrRev (strText, and the "s")
Response.write pos
%> RESULT: 13
Int () FUNCTION: Back numerical types, not rounded. SYNTAX: Int (number) ARGUMENTS: EXAMPLE: <% = INT (32.89%)> RESULT: 32 IsArray () FUNCTION: To determine whether an object array, returning to the boolean value. SYNTAX: IsArray (name) ARGUMENTS: EXAMPLE: <%
StrTest = "Test!"
Response.write IsArray (strTest)
%> RESULT: False IsDate () FUNCTION: To determine whether a date to return to boolean SYNTAX: IsDate (expression) ARGUMENTS: expression is any valid expression. EXAMPLE: <%
StrTest = "8/4/99"
Response.write IsDate (strTest)
%> RESULT: True IsEmpty () FUNCTION: whether a judge initialization back to the boolean value. SYNTAX: IsEmpty (expression) ARGUMENTS: EXAMPLE: <%
Dim i
Response.write IsEmpty (i)
%> RESULT: True IsNull () FUNCTION: whether a judge is empty, returning to the boolean value. SYNTAX: IsNull (expression) ARGUMENTS: EXAMPLE: <%
Dim i
Response.write IsNull (i)
%> RESULT: False IsNumeric () FUNCTION: To determine whether a figure back to the boolean value. SYNTAX: IsNumeric (expression) ARGUMENTS: EXAMPLE: <%
I = "345"
Response.write IsNumeric (i)
%> RESULT: True
Even if the figures add quotes, ASP or that it is digital. IsObject () FUNCTION: To determine whether an object back to the boolean value. SYNTAX: IsObject (expression) ARGUMENTS: EXAMPLE: <%
Set con = Server.CreateObject ( "ADODB.Connection")
Response.write IsObject (con)
%> RESULT: True LBound () FUNCTION: Back-dimensional array designated the smallest available subscript. SYNTAX: Lbound (arrayname [dimension]) ARGUMENTS:; dimension specified which peacekeepers to return to the lower bound of integers. That the use of a first-dimensional, two-dimensional said that the second, and so on. If the parameter dimension omitted, the default value of 1. EXAMPLE: <%
I = Array ( "Monday", "Tuesday", "Wednesday")
Response.write LBound (i)
%> RESULT: 0 LCase () FUNCTION: Back string lowercase form SYNTAX: Lcase (string) ARGUMENTS: string is any valid string expression. EXAMPLE: <%
StrTest = "This is a test!"
Response.write LCase (strTest)
%> RESULT: this is a test! Left () FUNCTION: Back to the left side of the string section length characters before the characters (including the first length characters). SYNTAX: Left (string, length) ARGUMENTS: EXAMPLE: <%
StrTest = "This is a test!"
Response.write Left (strTest, 3)
%> RESULT: Thi Len () FUNCTION: Back to the length of the string. SYNTAX: Len (string | varName) ARGUMENTS: EXAMPLE: <%
StrTest = "This is a test!"
Response.write Len (strTest)
%> RESULT: 15 LTrim () FUNCTION: Remove string left spaces. SYNTAX: LTrim (string) ARGUMENTS: EXAMPLE: <%
StrTest = "This is a test!"
Response.write LTrim (strTest)
%> RESULT: This is a test! Mid () FUNCTION: Back specific length of the string (from the start, the length of length). SYNTAX: Mid (string, start [length]) ARGUMENTS: EXAMPLE: <%
StrTest = "This is a test! Today is Monday."
Response.write Mid (strTest, 17, 5)
%> RESULT: Today Minute () FUNCTION: Back at the time of Kushiro. SYNTAX: Minute (time) ARGUMENTS: EXAMPLE: <% = Minute (12:45:32 PM # #)%> RESULT: 45 Month () FUNCTION: Back to date. SYNTAX: Month (date) ARGUMENTS: date is any valid date expression. EXAMPLE: <% = Month (# # 08/04/99)%> RESULT: 8 MonthName () FUNCTION: Returns a string identifying the specified month . SYNTAX: MonthName (month, [Abb]) ARGUMENTS: month is the numeric representation for a given month; Abb (optional) is a boolean value used to display month abbreviation. True will display the abbreviated month name and False (default) will not show the abbreviation. EXAMPLE: <% = MonthName (Month (# 08/04/99 #))%> RESULT: August Now () FUNCTION: Returns the current system date and time. SYNTAX: Now () ARGUMENTS: None EXAMPLE: <Now%% => RESULT: 8/4/99 9:30:16 AM Replace () FUNCTION: Returns a string in which a specified sub-string has been replaced with another substring a specified number of times. SYNTAX: Replace (strToBeSearched, strSearchFor, strReplaceWith [start [, count [compare]]]) ARGUMENTS: strToBeSearched is a string expression containing a sub-string to be replaced; strSearchFor is the string expression to search for within strToBeSearched; strReplaceWith is the string expression to replace sub-string strSearchFor; start (optional) is the numeric character position to begin search; count (optional) is a value indicating the comparision constant. EXAMPLE: <%
StrTest = "This is an apple!"
Response.write Replace (strTest, "apple" and "orange")
%> RESULT: This is an orange! Right () FUNCTION: the right to return to the first string length characters before the characters (including the first length characters). SYNTAX: Right (string, length) ARGUMENTS:. EXAMPLE: <%
StrTest = "This is an test!"
Response.write Right (strTest, 3)
%> RESULT: st! Rnd () FUNCTION: create a random number. SYNTAX: Rnd [(number)] ARGUMENTS: EXAMPLE: <%
Randomize ()
Response.write RND ()
%> RESULT: No one in the 0-1 between the few Round () FUNCTION: Back to the nearest specified median values. SYNTAX: Round (expression [, numRight]) ARGUMENTS: numRight figures show that the number of decimal places to the right rounding. If omitted, the function returns integer Round. EXAMPLE: <%
I = 32.45678
Response.write Round (i)
%> RESULT: 32 Rtrim () FUNCTION: remove the right of the string string. SYNTAX: Rtrim (string) ARGUMENTS: EXAMPLE: <%
StrTest = "This is a test!"
Response.write RTrim (strTest)
%> RESULT: This is a test! Second () FUNCTION: Back seconds. SYNTAX: Second (time) ARGUMENTS:. EXAMPLE: <% = Second (12:34:28 PM # #)%> RESULT: 28 StrReverse ( ) FUNCTION: anti-handling a string SYNTAX: StrReverse (string) ARGUMENTS: EXAMPLE: <%
StrTest = "This is a test!"
Response.write StrReverse (strTest)
%> RESULT:! Tset a si sihT Time () FUNCTION: Back system time. SYNTAX: Time () ARGUMENTS:. EXAMPLE: <% =% Time> RESULT: 9:58:28 AM Trim () FUNCTION: Remove string around the box. SYNTAX: Trim (string) ARGUMENTS: string is any valid string expression. EXAMPLE: <%
StrTest = "This is a test!"
Response.write Trim (strTest)
%> RESULT: This is a test! UBound () FUNCTION: Back designated array dimension of the largest available subscript>. SYNTAX: Ubound (arrayname [dimension]) ARGUMENTS:; dimension (optional) which returned to the designated peacekeeping on the integer sector. 1 said that the first dimension, 2 said that the second dimension, and so on. If the parameter dimension omitted, the default value of 1. EXAMPLE: <%
I = Array ( "Monday", "Tuesday", "Wednesday")
Response.write UBound (i)
%> RESULT: 2 UCase () FUNCTION: Back string of uppercase forms. SYNTAX: UCase (string) ARGUMENTS: EXAMPLE: <%
StrTest = "This is a test!"
Response.write UCase (strTest)
%> RESULT: THIS IS A TEST! VarType () FUNCTION: Back variables indicative of the type of value SYNTAX: VarType (varName) ARGUMENTS: EXAMPLE: <%
I = 3
Response.write varType (i)
%> RESULT: 2 (figures) are detailed in "constant asp" WeekDay () FUNCTION: Back in the days of the week. SYNTAX: WeekDay (date [firstdayofweek]) ARGUMENTS:. EXAMPLE: <%
D = # # 8/4/99
Response.write Weekday (d)
%> RESULT: 4 (Wednesday) WeekDayName () FUNCTION: the first few days of the week to return to the name. SYNTAX: WeekDayName (weekday [Abb [firstdayofweek]]) ARGUMENTS: Abb optional. Boolean value specifying whether the initials that the name of the days of week. If omitted, the default value of False, not abbreviations week the names of the days. Firstdayofweek the first day of the week specified numerical EXAMPLE: <%
D = # # 8/4/99
Response.write WeekdayName (Weekday (d))
%> RESULT: Wednesday Year () FUNCTION: Back to the current year. SYNTAX: Year (date) ARGUMENTS: EXAMPLE: <% = Year (# # 8/4/99)%> RESULT: 1999








0 Comments to “ASP function”
No Comments. Send your comment.
Leave a Reply
You must be logged in to post a comment.