+ Reply to Thread
Page 2 of 3 FirstFirst 1 2 3 LastLast
Results 11 to 20 of 26

Thread: VBScript Functions Reference

  1. #11
    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
    Reston, VA
    Posts
    4,545
    Blog Entries
    9
    Real Name
    Jason
    Rep Power
    22

    Chr

    Syntax: Chr(ANSIvalue)

    The Chr function converts an ANSI character code value to a character.

    Example(s):
    Code:
    This will output b
    <% =Chr(98) %> 
    jmurrayhead
    If you agree, give me rep.
    If you like it here...throw us a few bones to help support us.


  2. #12
    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
    Reston, VA
    Posts
    4,545
    Blog Entries
    9
    Real Name
    Jason
    Rep Power
    22

    CInt

    Syntax: CInt(number)

    The CInt function converts any number to the variant of subtype Integer.

    Converts to values ranging from -32,768 to 32,767

    Example(s):
    Code:
    This will output 1235 (rounded off)
    <% anynumber=1234.567 %> 
    <% =CInt(anynumber) %>
    
    jmurrayhead
    If you agree, give me rep.
    If you like it here...throw us a few bones to help support us.


  3. #13
    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
    Reston, VA
    Posts
    4,545
    Blog Entries
    9
    Real Name
    Jason
    Rep Power
    22

    CLng

    Syntax: CLng(number)

    The CLng function converts any number to the variant of subtype Long, with floating-point numbers rounded.

    Converts to integers ranging from -2,147,483,648 to 2,147,483,647.

    Example(s):
    Code:
    This will ouput 1235
    <% anynumber=1234.6 %> 
    <% =CLng(anynumber) %>
    
    jmurrayhead
    If you agree, give me rep.
    If you like it here...throw us a few bones to help support us.


  4. #14
    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
    Reston, VA
    Posts
    4,545
    Blog Entries
    9
    Real Name
    Jason
    Rep Power
    22

    Cos

    Syntax: Cos(number)

    The Cos function returns the cosine for a number (angle).

    Example(s):
    Code:
    This will output 0.52532198881773
    <% =Cos(45.0) %>
     
    This will output 0.52532198881773
    <% =Cos(-45.0) %>
    
    jmurrayhead
    If you agree, give me rep.
    If you like it here...throw us a few bones to help support us.


  5. #15
    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
    Reston, VA
    Posts
    4,545
    Blog Entries
    9
    Real Name
    Jason
    Rep Power
    22

    CreateObject

    Syntax: CreateObject(ServerName.TypeName, RemoteServerName)

    ServerName is the name of the application that provides the object. TypeName is the type (class) of the object to be created.
    The optional RemoteServerName argument was added in verson 5.0 and is used to create an object on a remote server. It is the name of the remote server. To use this argument, the internet security must be turned off.

    The CreateObject function is used to create an object of the type specified in the argument.

    The Set statement assigns the object reference to a variable or property. The keyword Nothing is used to unassign the object reference from the variable or property. Good programming techniques require that you unassign all objects before you exit the program.

    Example(s):
    Code:
    Creating an instance of Micrsoft Word
    <% 
    Set objWrd = CreateObject("Word.Application") 
    ... 
    ' Place any code you desire here 
    ... 
    Set objWrd = Nothing 
    %>
     
    Creating an object on a remote site
    <% 
    Set objFarAway = CreateObject("Word.Application", 
    "FarAwayServerName") 
    ... 
    ' Place any code you desire here 
    ... 
    Set objFarAway = Nothing 
    %>
    
    jmurrayhead
    If you agree, give me rep.
    If you like it here...throw us a few bones to help support us.


  6. #16
    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
    Reston, VA
    Posts
    4,545
    Blog Entries
    9
    Real Name
    Jason
    Rep Power
    22

    CSng

    Syntax: CSng(number)

    The CSng function converts any number to the variant of subtype Single.

    Converts to values ranging from -3.402823E38 to -1.401298E-45 for negative values and 1.401298E-45 to 3.402823E38 for positive values.

    Example(s):
    Code:
    This will output 5678.123
    <% anynumber=5678.123 %> 
    <% =CSng(anynumber) %>
    
    jmurrayhead
    If you agree, give me rep.
    If you like it here...throw us a few bones to help support us.


  7. #17
    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
    Reston, VA
    Posts
    4,545
    Blog Entries
    9
    Real Name
    Jason
    Rep Power
    22

    CStr

    Syntax: CStr(Expression)

    The CStr function converts an expression into a variant of subtype String.

    If the expression is Boolean, the output is a string containing either true or false. If the expression is a Date, the output is a string using the short-date format. If the expression is empty, the output is a zero length string. If the expression is an error, the output is a string with the word error followed by the error number. If the expression is numeric, the output string contains the number. If the expression is Null (does not exist), the output is a runtime error.

    Example(s):
    Code:
    This will output 5678
    <% anyexpression=5678 %> 
    <% =CStr(anyexpression) %>
    
    jmurrayhead
    If you agree, give me rep.
    If you like it here...throw us a few bones to help support us.


  8. #18
    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
    Reston, VA
    Posts
    4,545
    Blog Entries
    9
    Real Name
    Jason
    Rep Power
    22

    Date

    Syntax: Date

    The Date function returns the current date as determined by your computer system.

    Historically, a two-digit year (MM/DD/YY) was returned. However, courtesy of the millennium, a four-digit year is now returned (MM/DD/YYYY). The same applies to the DateValue function.

    Example(s):
    Code:
    This will output the current date
    <% =Date %>
    
    jmurrayhead
    If you agree, give me rep.
    If you like it here...throw us a few bones to help support us.


  9. #19
    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
    Reston, VA
    Posts
    4,545
    Blog Entries
    9
    Real Name
    Jason
    Rep Power
    22

    DateAdd

    Syntax: DateAdd(Interval, Number, Date)

    Interval - The Interval argument defines the the type of time interval you wish to add onto the date.

    You must place the setting inside double quotes.
    Number - The Number argument is a multiplier for the Interval argument (i.e., how many days, weeks, months, etc.). If this is a positive number, you will go forward in time. A negative number will go back in time. Date - The Date argument is a date or time.

    Possible interval settings:
    YYYY -Year
    Q - Quarter
    M - Month
    Y - Day Of Year
    D - Day
    W - WeekDay
    WW - Week Of Year
    H - Hour
    N - Minute
    S - Second

    Example(s):
    Code:
    This will ouput 3/16/99 4/27/99
    <% =Date %> 
    <% =DateAdd("WW", 6, Date) %>
     
    This will output 3/16/99 12:14:00 PM 3/16/99 12:14:30 PM
    <% =Now %> 
    <% =DateAdd("S", 30, Now) %>
     
    This will output 1/1/2001 1/1/3001
    <% ="1/1/2001" %> 
    <% =DateAdd("YYYY", 1000, "1/1/2001") %>
    
    jmurrayhead
    If you agree, give me rep.
    If you like it here...throw us a few bones to help support us.


  10. #20
    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
    Reston, VA
    Posts
    4,545
    Blog Entries
    9
    Real Name
    Jason
    Rep Power
    22

    DateDiff

    Syntax: DateDiff(Interval, Date1, Date2, FirstDayofWeek, FirstWeekofYear)

    Interval - The Interval argument defines the the type of time interval you wish to calculate the time difference.

    You must place the setting inside double quotes.

    Date1 - The Date1 argument is the first date.
    Date2 - The Date2 arguments is the second date.
    FirstDayofWeek - The FirstDayofWeek argument must only use the constants and values found below.
    FirstWeekofYear - The FirstWeekofYear argument must only use the constants and values found below.

    The DateDiff function calculates the amount of time between two different dates.

    Possible interval settings:
    YYYY -Year
    Q - Quarter
    M - Month
    Y - Day Of Year
    D - Day
    W - WeekDay
    WW - Week Of Year
    H - Hour
    N - Minute
    S - Second

    Date and Time Constants (constant - value - description):
    VBSunday-1-Sunday
    VBMonday-2-Monday
    VBTuesday-3-Tuesday
    VBWednesday-4-Wednesday
    VBThursday-5-Thursday
    VBFriday-6-Friday
    VBSaturday-7-Saturday
    VBFirstJan1-1-Week of January 1
    VBFirstFourDays-2-First week of the year that has at least four days
    VBFirstFullWeek-3-First full week of the year
    VBUseSystem-0-Use the date format of the computer's regionsl settings
    VBUseSystemDayOfWeek-0-Use the first full day of the week as defined by the system settings

    Example(s):

    Code:
    Code:
    This will ouput 291
    <%=DateDiff("d", Date, "1/1/2000") %>
     
    This will output -3130748108
    <% olddate = #6/26/43# %> 
    <% nowdate = Now %> 
    <% =DateDiff("s", nowdate, olddate) %>
     
    This will output 93
    <% =DateDiff("w", Date, "1/1/2001", 3) %>
     
    This will output 94
    <% =DateDiff("ww", Date, "1/1/2001", 1, VBFIRSTFOURDAYS)%>
    
    jmurrayhead
    If you agree, give me rep.
    If you like it here...throw us a few bones to help support us.


+ Reply to Thread
Page 2 of 3 FirstFirst 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