Photo Gallery Member List Search Calendars FAQ Ticket List Log Out


VBScript functionality

 
Logged in as: Guest
arrSession:exec spGetSession 2,16,27542
 Active Users: There are 0 members and 0 guests.
 Users viewing this topic: none
 

 

 
  
  Printable Version
All Forums >> [Scripting] >> Post a VBScript >> VBScript functionality
  Do you like VisualBasicScript.com? Link to us and help spread the word about our forum. Thanks!
Page: [1]
Login
Message << Older Topic   Newer Topic >>
 VBScript functionality - 10/29/2005 6:20:39 PM   
  TNO


Posts: 1064
Score: 10
Joined: 12/18/2004
From: thenewobjective.com
Status: offline
This may be a little blasphemous in a vbscript forum but here it goes:

Here is a compilation/creation/collection of recreated vbscript functions for use in JavaScript. This will be helpful to those (like myself). Who try to use the best of both worlds in their projects. This will also help those unfamiliar with the language to simplify some more complex problems.

Here's a quick overview of the contents:






CreateObject(x)
Translates into: new ActiveXObject(x)

dateDiff(p_Interval, p_Date1, p_Date2,p_firstdayofweek, p_firstweekofyear)
Returns the number of intervals between two dates

datePart(p_Interval, p_Date,p_firstdayofweek, p_firstweekofyear)
Returns the specified part of a given date.

FormatCurrency(Expression, NumDigitsAfterDecimal,IncludeLeadingDigit,UseParensForNegativeNumbers, GroupDigits)

FormatDateTime(datetime, FormatType)

FormatNumber(Expression, NumDigitsAfterDecimal,IncludeLeadingDigit,UseParensForNegativeNumbers, GroupDigits)

FormatPercent(Expression, NumDigitsAfterDecimal,IncludeLeadingDigit,UseParensForNegativeNumbers, GroupDigits)

InStr(strSearch,charSearchFor)
Returns the first location a substring SearchForStr that was found in the string str

isDate(p_Expression)

Left(string, length)
Returns a specified number of characters from the left side of a string.

Len(str)
Returns the number of characters in a string.

LTrim(str)
Returns a copy of a string without leading spaces.

Mid(str,start,len)
Returns a specified number of characters from a string.
monthName(p_Date, p_abbreviate)

Now()
Returns the current date and time.

Right(string, length)
Returns a specified number of characters from the right side of a string

RTrim(string)
Returns a copy of a string without trailing spaces.

StrReverse(strInput)
Returns the reverse of a string.

Trim(strInput)
Removes leading and trailing spaces

weekdayName(p_Date, p_abbreviate)






<Updated library below>

< Message edited by TNO -- 10/18/2006 10:02:24 PM >


_____________________________

To iterate is human, to recurse divine. -- L. Peter Deutsch
 
 
Revisions: 1 | Post #: 1
 
 RE: VBScript functionality - 10/18/2006 9:58:06 PM   
  TNO


Posts: 1064
Score: 10
Joined: 12/18/2004
From: thenewobjective.com
Status: offline
I almost forgot about my ancient post here. Figured its time for an update of some sort:

//version: 1.01 updates in red

CreateObject(x)
Translates into: new ActiveXObject(x)

dateAdd(p_Interval, p_Number, p_Date) <--Supports Milliseconds!!!

dateDiff(p_Interval, p_Date1, p_Date2,p_firstdayofweek, p_firstweekofyear) <--Supports Milliseconds!!!
Returns the number of intervals between two dates

datePart(p_Interval, p_Date,p_firstdayofweek, p_firstweekofyear)
Returns the specified part of a given date.

FormatCurrency(Expression, NumDigitsAfterDecimal,IncludeLeadingDigit,UseParensForNegativeNumbers, GroupDigits)

FormatDateTime(datetime, FormatType)

FormatNumber(Expression, NumDigitsAfterDecimal,IncludeLeadingDigit,UseParensForNegativeNumbers, GroupDigits)

FormatPercent(Expression, NumDigitsAfterDecimal,IncludeLeadingDigit,UseParensForNegativeNumbers, GroupDigits)

InStr(strSearch,charSearchFor)
Returns the first location a substring SearchForStr that was found in the string str

isDate(p_Expression)

Left(string, length)
Returns a specified number of characters from the left side of a string.

Len(str)
Returns the number of characters in a string.

LTrim(str)
Returns a copy of a string without leading spaces.

Mid(str,start,len)
Returns a specified number of characters from a string.
monthName(p_Date, p_abbreviate)

monthName(p_Date, p_abbreviate)

Now()

Returns the current date and time.

Right(string, length)
Returns a specified number of characters from the right side of a string

RTrim(string)
Returns a copy of a string without trailing spaces.

StrReverse(strInput)
Returns the reverse of a string.

Trim(strInput)
Removes leading and trailing spaces

weekdayName(p_Date, p_abbreviate)

If there is functionality you'd like to see added to this library let me know!


Attachment (1)

< Message edited by TNO -- 10/18/2006 10:00:21 PM >


_____________________________

To iterate is human, to recurse divine. -- L. Peter Deutsch

(in reply to TNO)
 
 
Revisions: 1 | Post #: 2
 
 
 
  

If you found our site useful please link to us <a href="http://www.visualbasicscript.com">VisualBasicScript.com</a>.
All Forums >> [Scripting] >> Post a VBScript >> VBScript functionality Page: [1]
Jump to:





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts