VBScript
VBScript
Session 10
Session 10
?What we learn last session
?What we learn last session
Conversion Functions.
Conversion Functions.
Subjects for session 10
Subjects for session 10
VBScript string manipulation.
VBScript string manipulation.
VBScript string math.
VBScript string math.
VBScript date manipulation.
VBScript date manipulation.
VBScript string manipulation
VBScript string manipulation
InStrInStr - Returns the position of the first - Returns the position of the first occurrence of one string withinoccurrence of one string within another.
another.
InStrRevInStrRev - Returns the position of an occurrence of one string - Returns the position of an occurrence of one string withinwithin another, from the end of string.
another, from the end of string.
LenLen - Returns the number of characters in a string or - Returns the number of characters in a string or the number of bytesthe number of bytes required to store a variable.
required to store a variable.
LCaseLCase - Returns a string that has been converted to l- Returns a string that has been converted to lowercase.owercase.
UCaseUCase - Returns a string that has been converted to uppercase.- Returns a string that has been converted to uppercase.
ReplaceReplace - Returns a string in which a specified substring has been- Returns a string in which a specified substring has been replaced with another substring a specified number of tim
replaced with another substring a specified number of times.es.
SpaceSpace - Returns a string consisting of the - Returns a string consisting of the specified number of spaces.specified number of spaces.
StringString – Returns a repeating character string of the length specifi– Returns a repeating character string of the length specified.ed.
StrReverseStrReverse – Returns a string in wh– Returns a string in which the character order of a specifiedich the character order of a specified string is reversed.
string is reversed.
Trim, LTrim, RTrimTrim, LTrim, RTrim - Returns a copy of a string without leading, trailing,- Returns a copy of a string without leading, trailing, or both leading and trailing
VBScript string manipulation
VBScript string manipulation
LeftLeft - Returns a specified number of characters from the left side- Returns a specified number of characters from the left side
of a string. of a string.
RightRight - Returns a specified number of characters from the right- Returns a specified number of characters from the right
side of a string. side of a string.
MidMid - Returns a specified number of characters from a string.- Returns a specified number of characters from a string.
JoinJoin - Returns a string created by joining a number of substrings- Returns a string created by joining a number of substrings
contained in an array. contained in an array.
SplitSplit - Returns a zero-based, one-dimensional array containing a- Returns a zero-based, one-dimensional array containing a
specified number of substrings. specified number of substrings.
StrCompStrComp - Returns a value indicating the result of a string- Returns a value indicating the result of a string
comparison. comparison.
FilterFilter -- Returns a zero-based array containing a subset of a Returns a zero-based array containing a subset of a stringstring
array based on a specified filter criteria. array based on a specified filter criteria.
VBScript math manipulation
VBScript math manipulation
AbsAbs - Returns the absolute value of a number.- Returns the absolute value of a number.
AtnAtn - Returns the arctangent of a number.- Returns the arctangent of a number.
CosCos - Returns the cosine of an angle.- Returns the cosine of an angle.
ExpExp - Returns- Returns ee (the base of natural logarithms) raised to a(the base of natural logarithms) raised to a
power. power.
LogLog - Returns the natural logarithm of a number.- Returns the natural logarithm of a number.
SinSin - Returns the sine of an angle.- Returns the sine of an angle.
TanTan - Returns the tangent of an angle.- Returns the tangent of an angle.
RndRnd - Returns a random number.- Returns a random number.
RoundRound - Returns a number rounded to a specified number of - Returns a number rounded to a specified number of
decimal places. decimal places.
SgnSgn -- Returns an integer indicating the sign of a Returns an integer indicating the sign of a number.number.
VBScript date manipulation
VBScript date manipulation
DateDate -- Returns the current system date.Returns the current system date.
TimeTime - Returns a- Returns a VariantVariant of subtypeof subtype DateDate indicating the currentindicating the current
system time. system time.
DayDay - Returns a whole number between 1 and 31, inclusive,- Returns a whole number between 1 and 31, inclusive,
representing the day of the month. representing the day of the month.
MonthMonth - Returns a whole number between 1 and 12, inclusive,- Returns a whole number between 1 and 12, inclusive,
representing the month of the year. representing the month of the year.
MonthNameMonthName - Returns a string indicating the specified month.- Returns a string indicating the specified month.
WeekDayWeekDay - Returns a whole number representing the day of the- Returns a whole number representing the day of the
week. week.
WeekDayNameWeekDayName - Returns a string indicating the specified day of - Returns a string indicating the specified day of
the week. the week.
VBScript date manipulation
VBScript date manipulation
Hour
Hour - Returns a whole number between 0 and
- Returns a whole number between 0 and
23, inclusive, representing the hour of the day.
23, inclusive, representing the hour of the day.
Minute
Minute - Returns a whole number between 0
- Returns a whole number between 0
and 59, inclusive, representing the minute of
and 59, inclusive, representing the minute of
the hour.
the hour.
Second
Second - Returns a whole number between 0
- Returns a whole number between 0
and 59, inclusive, representing the second of
and 59, inclusive, representing the second of
the minute.
the minute.
Now
Now - Returns the current date and time
- Returns the current date and time
according to the setting of
according to the setting of your computer's
your computer's
system date and time.
VBScript date manipulation
VBScript date manipulation
DateAddDateAdd - Returns a date to which a specified time interval has- Returns a date to which a specified time interval has
been added. been added.
DateDiff DateDiff - Returns the number of intervals between two dates.- Returns the number of intervals between two dates.
DatePartDatePart - Returns the specified part of a given date.- Returns the specified part of a given date.
DateSerialDateSerial - Returns a- Returns a VariantVariant of subtypeof subtype DateDate for a specifiedfor a specified
year, month, and day. year, month, and day.
DateValueDateValue - Returns a- Returns a VariantVariant of subtypeof subtype DateDate..
TimeSerialTimeSerial - Returns a- Returns a VariantVariant of subtypeof subtype DateDate containing thecontaining the
time for a specific hour, minute, and second. time for a specific hour, minute, and second.
TimeValueTimeValue - Returns a- Returns a VariantVariant of subtypeof subtype DateDate containing thecontaining the
time. time.
TimerTimer -- Returns the number of seconds that have elapsedReturns the number of seconds that have elapsed
since 12:00 AM (midnight). since 12:00 AM (midnight).
.VBScript Formatting Strings
.VBScript Formatting Strings
FormatCurrency
FormatCurrency - Returns an expression
- Returns an expression
formatted as a currency value using the currency
formatted as a currency value using the currency
symbol defined in the system control panel.
symbol defined in the system control panel.
FormatDateTime
FormatDateTime - Returns an expression
- Returns an expression
formatted as a date or time.
formatted as a date or time.
FormatNumber
FormatNumber - Returns an expression formatted
- Returns an expression formatted
as a number.
as a number.
FormatPercent
FormatPercent - Returns an expression formatted
- Returns an expression formatted
as a percentage (multiplied by 100) with a trailing
as a percentage (multiplied by 100) with a trailing
% character.
Make sure to visit us
Make sure to visit us
Tutorials
Tutorials
Articles
Articles
Proikects
Proikects