Closed Thread
Page 1 of 3 1 2 3 LastLast
Results 1 to 10 of 26

Thread: VBScript Functions Reference

  1. #1
    The Barnfather jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead's Avatar
    Join Date
    Mar 2008
    Location
    Washington, D.C.
    Posts
    2,347
    Blog Entries
    9
    Rep Power
    19

    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, give me rep. If my post helped you, click "Thanks".
    If you like it here...throw us a few bones to help support us.


  2. #2
    The Barnfather jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead's Avatar
    Join Date
    Mar 2008
    Location
    Washington, D.C.
    Posts
    2,347
    Blog Entries
    9
    Rep Power
    19

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

    jmurrayhead
    If you agree, give me rep. If my post helped you, click "Thanks".
    If you like it here...throw us a few bones to help support us.


  3. #3
    The Barnfather jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead's Avatar
    Join Date
    Mar 2008
    Location
    Washington, D.C.
    Posts
    2,347
    Blog Entries
    9
    Rep Power
    19

    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) %> 
    jmurrayhead
    If you agree, give me rep. If my post helped you, click "Thanks".
    If you like it here...throw us a few bones to help support us.


  4. #4
    The Barnfather jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead's Avatar
    Join Date
    Mar 2008
    Location
    Washington, D.C.
    Posts
    2,347
    Blog Entries
    9
    Rep Power
    19

    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") %>
    
    jmurrayhead
    If you agree, give me rep. If my post helped you, click "Thanks".
    If you like it here...throw us a few bones to help support us.


  5. #5
    The Barnfather jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead's Avatar
    Join Date
    Mar 2008
    Location
    Washington, D.C.
    Posts
    2,347
    Blog Entries
    9
    Rep Power
    19

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


    jmurrayhead
    If you agree, give me rep. If my post helped you, click "Thanks".
    If you like it here...throw us a few bones to help support us.


  6. #6
    The Barnfather jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead's Avatar
    Join Date
    Mar 2008
    Location
    Washington, D.C.
    Posts
    2,347
    Blog Entries
    9
    Rep Power
    19

    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) %>
    
    jmurrayhead
    If you agree, give me rep. If my post helped you, click "Thanks".
    If you like it here...throw us a few bones to help support us.


  7. #7
    The Barnfather jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead's Avatar
    Join Date
    Mar 2008
    Location
    Washington, D.C.
    Posts
    2,347
    Blog Entries
    9
    Rep Power
    19

    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) %>
    
    jmurrayhead
    If you agree, give me rep. If my post helped you, click "Thanks".
    If you like it here...throw us a few bones to help support us.


  8. #8
    The Barnfather jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead's Avatar
    Join Date
    Mar 2008
    Location
    Washington, D.C.
    Posts
    2,347
    Blog Entries
    9
    Rep Power
    19

    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) %>
    
    jmurrayhead
    If you agree, give me rep. If my post helped you, click "Thanks".
    If you like it here...throw us a few bones to help support us.


  9. #9
    The Barnfather jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead's Avatar
    Join Date
    Mar 2008
    Location
    Washington, D.C.
    Posts
    2,347
    Blog Entries
    9
    Rep Power
    19

    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) %>
    
    jmurrayhead
    If you agree, give me rep. If my post helped you, click "Thanks".
    If you like it here...throw us a few bones to help support us.


  10. #10
    The Barnfather jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead's Avatar
    Join Date
    Mar 2008
    Location
    Washington, D.C.
    Posts
    2,347
    Blog Entries
    9
    Rep Power
    19

    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) %>
    
    jmurrayhead
    If you agree, give me rep. If my post helped you, click "Thanks".
    If you like it here...throw us a few bones to help support us.


Closed Thread
Page 1 of 3 1 2 3 LastLast

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

SEO by vBSEO