Visual basic has a number of build in functions that help the programmer to write efficient program reducing the programming complexity.
The various types of functions and their need are stated as follows:
a. String Functions
Str - To convert number values to string values.
Lcase$ - To return a text string with all characters converted to
lowercase.
Ucase$ - To return a text string with all characters converted to
uppercase.
Rtrim$ - To build a text string with all the spaces at the end of
the string removed.
Ltrim$ - To build a text string with all the spaces at the start of
the string removed.
Len - To return the length of the string i.e. number of characters
of a string.
b. Financial Functions
Rate - To return the interest rate.
DDB - To return the depreciated value of an asset for a specific duration
using
the double-declining balance method or some other method you specify.
FV - To return the future value based on periodic, constant payments
and a
constant interest rate.
Pmt - To return the payment based on periodic ,constant payments and
a
constant interest rate.
PV - To return the present value based on periodic, constant payments
to be
paid in the future and a constant interest rate.
c. Numeric Functions
Val - To convert Character string to number.
CLng - To convert Number to Long
Ccur - To convert Number to Currency
CDbl - To convert Number to Double
CSgn - To convert Number to Single.
Some new functions Available in Vb are:
- Asc Function
- CBool Function
- CByte Function
- CCur Function
- CDate Function
- CDec Function
- CDbl Function
- Chr Function
- CInt Function
- CLng Function
- CSng Function
- CStr Function
- CVar Function
- CVErr Function
- Format Function
- Hex Function
- Oct Function
- Str Function
- Val Function