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 on Wednesday, October 18, 2006 11:02 PM>