Register Blogs FAQ Members List Social Groups Calendar Search Today's Posts Mark Forums Read

Go Back   DeveloperBarn Forums > Programming & Scripting > ASP Development

Sponsored Links

Discuss "VBScript Functions Reference" in the ASP Development forum.

ASP Development - Learn coding practices and tips to get the best out of your Active Server Pages (ASP). Visit the ASP Development forum for help with ASP/VBScript and ASP/JScript applications.


Closed Thread
 
LinkBack Thread Tools Display Modes
  #1  
Old March 23rd, 2008, 04:13 PM
jmurrayhead's Avatar
The Barnfather
 
Join Date: Mar 2008
Location: Reston, VA, USA
Posts: 951
Thanks: 22
Thanked 93 Times in 90 Posts
Blog Entries: 6
Rep Power: 4
jmurrayhead is a jewel in the roughjmurrayhead is a jewel in the roughjmurrayhead is a jewel in the roughjmurrayhead is a jewel in the rough

Awards Showcase
Microsoft Windows Microsoft SQL Server Microsoft .Net Classic ASP 
Total Awards: 4

Default VBScript Functions Reference

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
Exp

more to come soon...
__________________
jmurrayhead
If you agree with me... click the icon!
If my post solved your problem, click the button in the lower right-hand corner of the post.

If you like it here...throw us a few bones to help
support us.

Join our Folding team: DeveloperBarn Folding

Sponsored Links
  #2  
Old March 23rd, 2008, 04:16 PM
jmurrayhead's Avatar
The Barnfather
 
Join Date: Mar 2008
Location: Reston, VA, USA
Posts: 951
Thanks: 22
Thanked 93 Times in 90 Posts
Blog Entries: 6
Rep Power: 4
jmurrayhead is a jewel in the roughjmurrayhead is a jewel in the roughjmurrayhead is a jewel in the roughjmurrayhead is a jewel in the rough

Awards Showcase
Microsoft Windows Microsoft SQL Server Microsoft .Net Classic ASP 
Total Awards: 4

Default Abs

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) %> 

  #3  
Old March 23rd, 2008, 04:25 PM
jmurrayhead's Avatar
The Barnfather
 
Join Date: Mar 2008
Location: Reston, VA, USA
Posts: 951
Thanks: 22
Thanked 93 Times in 90 Posts
Blog Entries: 6
Rep Power: 4
jmurrayhead is a jewel in the roughjmurrayhead is a jewel in the roughjmurrayhead is a jewel in the roughjmurrayhead is a jewel in the rough

Awards Showcase
Microsoft Windows Microsoft SQL Server Microsoft .Net Classic ASP 
Total Awards: 4

Default Array

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) %> 
  #4  
Old March 23rd, 2008, 04:31 PM
jmurrayhead's Avatar
The Barnfather
 
Join Date: Mar 2008
Location: Reston, VA, USA
Posts: 951
Thanks: 22
Thanked 93 Times in 90 Posts
Blog Entries: 6
Rep Power: 4
jmurrayhead is a jewel in the roughjmurrayhead is a jewel in the roughjmurrayhead is a jewel in the roughjmurrayhead is a jewel in the rough

Awards Showcase
Microsoft Windows Microsoft SQL Server Microsoft .Net Classic ASP 
Total Awards: 4

Default Asc

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") %>
  #5  
Old March 23rd, 2008, 04:36 PM
jmurrayhead's Avatar
The Barnfather
 
Join Date: Mar 2008
Location: Reston, VA, USA
Posts: 951
Thanks: 22
Thanked 93 Times in 90 Posts
Blog Entries: 6
Rep Power: 4
jmurrayhead is a jewel in the roughjmurrayhead is a jewel in the roughjmurrayhead is a jewel in the roughjmurrayhead is a jewel in the rough

Awards Showcase
Microsoft Windows Microsoft SQL Server Microsoft .Net Classic ASP 
Total Awards: 4

Default Atn

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) %> 


  #6  
Old March 23rd, 2008, 04:41 PM
jmurrayhead's Avatar
The Barnfather
 
Join Date: Mar 2008
Location: Reston, VA, USA
Posts: 951
Thanks: 22
Thanked 93 Times in 90 Posts
Blog Entries: 6
Rep Power: 4
jmurrayhead is a jewel in the roughjmurrayhead is a jewel in the roughjmurrayhead is a jewel in the roughjmurrayhead is a jewel in the rough

Awards Showcase
Microsoft Windows Microsoft SQL Server Microsoft .Net Classic ASP 
Total Awards: 4

Default CBool

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) %>
  #7  
Old March 23rd, 2008, 04:45 PM
jmurrayhead's Avatar
The Barnfather
 
Join Date: Mar 2008
Location: Reston, VA, USA
Posts: 951
Thanks: 22
Thanked 93 Times in 90 Posts
Blog Entries: 6
Rep Power: 4
jmurrayhead is a jewel in the roughjmurrayhead is a jewel in the roughjmurrayhead is a jewel in the roughjmurrayhead is a jewel in the rough

Awards Showcase
Microsoft Windows Microsoft SQL Server Microsoft .Net Classic ASP 
Total Awards: 4

Default CByte

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) %>
  #8  
Old March 23rd, 2008, 04:51 PM
jmurrayhead's Avatar
The Barnfather
 
Join Date: Mar 2008
Location: Reston, VA, USA
Posts: 951
Thanks: 22
Thanked 93 Times in 90 Posts
Blog Entries: 6
Rep Power: 4
jmurrayhead is a jewel in the roughjmurrayhead is a jewel in the roughjmurrayhead is a jewel in the roughjmurrayhead is a jewel in the rough

Awards Showcase
Microsoft Windows Microsoft SQL Server Microsoft .Net Classic ASP 
Total Awards: 4

Default CCur

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) %>
  #9  
Old March 23rd, 2008, 05:14 PM
jmurrayhead's Avatar
The Barnfather
 
Join Date: Mar 2008
Location: Reston, VA, USA
Posts: 951
Thanks: 22
Thanked 93 Times in 90 Posts
Blog Entries: 6
Rep Power: 4
jmurrayhead is a jewel in the roughjmurrayhead is a jewel in the roughjmurrayhead is a jewel in the roughjmurrayhead is a jewel in the rough

Awards Showcase
Microsoft Windows Microsoft SQL Server Microsoft .Net Classic ASP 
Total Awards: 4

Default CDate

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) %>
  #10  
Old March 23rd, 2008, 05:22 PM
jmurrayhead's Avatar
The Barnfather
 
Join Date: Mar 2008
Location: Reston, VA, USA
Posts: 951
Thanks: 22
Thanked 93 Times in 90 Posts
Blog Entries: 6
Rep Power: 4
jmurrayhead is a jewel in the roughjmurrayhead is a jewel in the roughjmurrayhead is a jewel in the roughjmurrayhead is a jewel in the rough

Awards Showcase
Microsoft Windows Microsoft SQL Server Microsoft .Net Classic ASP 
Total Awards: 4

Default CDbl

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) %>
Closed Thread

  DeveloperBarn Forums > Programming & Scripting > ASP Development

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump


All times are GMT -4. The time now is 09:41 AM.



Content Relevant URLs by vBSEO 3.2.0