![]() |
| |||||||
![]() | « Previous Thread | Next Thread » |
| | LinkBack | Thread Tools | Display Modes |
| ||||
| This thread will serve as a reference for VBScript functions that you may use in your ASP scripts. Abs Array Asc Atn CBool CByte CCur CDate CDbl Chr CInt CLng Cos CreateObject CSng CStr Date DateAdd DateDiff DatePart DateSerial DateValue Day Eval more to come soon...
__________________ jmurrayhead Did I help you out? Make me popular by clicking the icon!If you found a post helpful, please click the button in the lower right-hand corner of the post.Powered by ASP.Net |
| Sponsored Links |
| ||||
| Syntax: Abs(number) The Abs function returns the absolute value for a number. Negative numbers become positive. Positive numbers remain positive. Example(s): Code: This will output 127.89 <% =Abs(-127.89) %> This will also output 127.89 <% =Abs(127.89) %> |
| ||||
| Syntax: Array(List) The Array function is used to create a static one-dimension array. A dynamic array cannot be declared using the Array function. Keep in mind that the first element in an array is always labeled zero. For example, myarray(0). The List argument is a list of values that will become elements of the array. You can declare a dynamic array using the Dim and ReDim statements. Example(s): Code: This is a static array that will output A B C D
<% myarray = array("A", "B", "C", "D") %>
<% =myarray(0) %>
<% =myarray(1) %>
<% =myarray(2) %>
<% =myarray(3) %>
This is a dynamic array
<%
Dim SomeArray()
...
ReDim SomeArray(22)
...
ReDim SomeArray(500)
%>
A three-dimensional array
<% Dim ThreeDimensionArray(22, 14, 200) %> |
| ||||
| Syntax: Asc(string) The Asc function returns the ANSI character code value for the first character in a string. Example(s): Code: This will output 97. Note that the ANSI value is only returned for 'a', the first character in the string.
<% =Asc("abcde fghij klmno pqrst uvwxyz") %>
|
| ||||
| Syntax: Atn(number) The Atn function returns the arctangent for a number Example(s): Code: This will output 1.54857776146818 <% =Atn(45.0) %> This will output -1.54857776146818 <% =Atn(-45.0) %> |
| ||||
| Syntax: CBool(number) The CBool function converts any number to the variant of subtype Boolean. Example(s): Code: This will return True <% anyNumber=7.77 %> <% =CBool(anyNumber) %> This will return False <% notNumber=abc %> <% =CBool(notNumber) %> |
| ||||
| Syntax: CByte(number) The CByte function converts any number between 0 and 255 to the variant of subtype Byte. Example(s): Code: This will ouput 10 <% anynumber=(9.876) %> <% =CByte(anynumber) %> This will output 255 <% anynumber=(255) %> <% =CByte(anynumber) %> |
| ||||
| Syntax: CCur(number) The CCur function converts any number or numeric string to the variant of subtype Currency. Converts to currency values ranging from -922,337,203,685,477.5808 to 922,337,203,685,477.5807 Example(s): Code: This will ouput 12345
<% anynumber=(12345) %>
<% =CCur(any_number) %>
Using a numeric string, this will output 98765
<% any_numeric_string=("98765") %>
<% =CCur(any_numeric_string) %>
This function also rounds off to 4 decimal places. This will output 55555.1235
<% anynumber=(55555.123456) %>
<% =CCur(anynumber) %>
|
| ||||
| Syntax: CDate(date) The CDate function converts any valid date and time expression to the variant of subtype Date. The default date output will be of the format: **/**/** The default time output will be of the format: **:**:** *M Converted date values can range from January 1, 100 to December 31, 9999. Example(s): Code: This will output 6/26/43 <% anydate = "June 26, 1943" %> <% =CDate(anydate) %> This will ouput the same as above <% anydate = #6/26/43# %> <% =CDate(anydate) %> This will output 2:23:59 PM <% anytime="2:23:59 PM" %> <% =CDate(anytime) %> |
| ||||
| Syntax: CDbl(number) The CDbl function converts any number to the variant of subtype Double. Converted values can range from -1.79769313486232E308 to -4.94065645841247E-324 for negative values and 4.94065645841247E-324 to 1.79769313486232E308 for positive values. Example(s): Code: This will return 1234.5 <% anynumber=1234.5 %> <% =CDbl(anynumber) %> |
![]() |
|
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|
| Sponsored Links |
| ASP.NET Resource Index a directory of ASP.NET tutorials, applications, scripts, assemblies and articles for the novice to professional developer. Free Web Directory Including Chats and Forums Resources, Offer automatic, instant and free directory submissions. | URLZ Web Directory URLZ Web Directory Free Web Directory - Add Your Link The Little Web Directory | Free Web Directory Pegasus free web directory is a free directory organised by categories. Web Directory & SEO Services dirroot web directory |