DeveloperBarn Forums

Go Back   DeveloperBarn Forums > Programming & Scripting > ASP Development

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). The Classic ASP forum is for ASP/VBScript and ASP/JScript applications.


Closed Thread « Previous Thread | Next Thread »
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old March 23rd, 2008, 04:13 PM
jmurrayhead's Avatar
Your Lord & Master

 
Join Date: Mar 2008
Location: Reston, VA, USA
Posts: 543
Thanks: 14
Thanked 41 Times in 40 Posts
Blog Entries: 2
Rep Power: 1
jmurrayhead will become famous soon enough

Awards Showcase
Microsoft .Net Microsoft SQL Server Microsoft Windows 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

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
  #2 (permalink)  
Old March 23rd, 2008, 04:16 PM
jmurrayhead's Avatar
Your Lord & Master

 
Join Date: Mar 2008
Location: Reston, VA, USA
Posts: 543
Thanks: 14
Thanked 41 Times in 40 Posts
Blog Entries: 2
Rep Power: 1
jmurrayhead will become famous soon enough

Awards Showcase
Microsoft .Net Microsoft SQL Server Microsoft Windows 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 (permalink)  
Old March 23rd, 2008, 04:25 PM
jmurrayhead's Avatar
Your Lord & Master

 
Join Date: Mar 2008
Location: Reston, VA, USA
Posts: 543
Thanks: 14
Thanked 41 Times in 40 Posts
Blog Entries: 2
Rep Power: 1
jmurrayhead will become famous soon enough

Awards Showcase
Microsoft .Net Microsoft SQL Server Microsoft Windows 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 (permalink)  
Old March 23rd, 2008, 04:31 PM
jmurrayhead's Avatar
Your Lord & Master

 
Join Date: Mar 2008
Location: Reston, VA, USA
Posts: 543
Thanks: 14
Thanked 41 Times in 40 Posts
Blog Entries: 2
Rep Power: 1
jmurrayhead will become famous soon enough

Awards Showcase
Microsoft .Net Microsoft SQL Server Microsoft Windows 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 (permalink)  
Old March 23rd, 2008, 04:36 PM
jmurrayhead's Avatar
Your Lord & Master

 
Join Date: Mar 2008
Location: Reston, VA, USA
Posts: 543
Thanks: 14
Thanked 41 Times in 40 Posts
Blog Entries: 2
Rep Power: 1
jmurrayhead will become famous soon enough

Awards Showcase
Microsoft .Net Microsoft SQL Server Microsoft Windows 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 (permalink)  
Old March 23rd, 2008, 04:41 PM
jmurrayhead's Avatar
Your Lord & Master

 
Join Date: Mar 2008
Location: Reston, VA, USA
Posts: 543
Thanks: 14
Thanked 41 Times in 40 Posts
Blog Entries: 2
Rep Power: 1
jmurrayhead will become famous soon enough

Awards Showcase
Microsoft .Net Microsoft SQL Server Microsoft Windows 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 (permalink)  
Old March 23rd, 2008, 04:45 PM
jmurrayhead's Avatar
Your Lord & Master

 
Join Date: Mar 2008
Location: Reston, VA, USA
Posts: 543
Thanks: 14
Thanked 41 Times in 40 Posts
Blog Entries: 2
Rep Power: 1
jmurrayhead will become famous soon enough

Awards Showcase
Microsoft .Net Microsoft SQL Server Microsoft Windows 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 (permalink)  
Old March 23rd, 2008, 04:51 PM
jmurrayhead's Avatar
Your Lord & Master

 
Join Date: Mar 2008
Location: Reston, VA, USA
Posts: 543
Thanks: 14
Thanked 41 Times in 40 Posts
Blog Entries: 2
Rep Power: 1
jmurrayhead will become famous soon enough

Awards Showcase
Microsoft .Net Microsoft SQL Server Microsoft Windows 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 (permalink)  
Old March 23rd, 2008, 05:14 PM
jmurrayhead's Avatar
Your Lord & Master

 
Join Date: Mar 2008
Location: Reston, VA, USA
Posts: 543
Thanks: 14
Thanked 41 Times in 40 Posts
Blog Entries: 2
Rep Power: 1
jmurrayhead will become famous soon enough

Awards Showcase
Microsoft .Net Microsoft SQL Server Microsoft Windows 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 (permalink)  
Old March 23rd, 2008, 05:22 PM
jmurrayhead's Avatar
Your Lord & Master

 
Join Date: Mar 2008
Location: Reston, VA, USA
Posts: 543
Thanks: 14
Thanked 41 Times in 40 Posts
Blog Entries: 2
Rep Power: 1
jmurrayhead will become famous soon enough

Awards Showcase
Microsoft .Net Microsoft SQL Server Microsoft Windows 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


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


All times are GMT -4. The time now is 12:22 AM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.2.0
Copyright © 2008 DeveloperBarn.com

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46