vb language code complete

Microsoft launched VisualBasic is easy to learn, powerful programming tools, is a visual, object-oriented and event-driven way of a structured high-level programming language, can easily use VB development for various applications in the Windows environment .

Vb language is code complete, respectively, from five common language of vb code to paper describes the detailed description to follow Xiaobian look at it.
vb language code complete
vb language code complete
1, numerical functions:
abs (num): returns the absolute value
sgn (num): num> 0 1; num = 0 0; num <0 -1; Analyzing positive and negative values
hex (num): Returns the hexadecimal value directly represents: & Hxx maximum 8
oct (num): Returns the octal value directly represents: & Oxx maximum 8
sqr (num): returns the square root num> 0
int (num): rounding int (99.8) = 99; int (-99.2) = 100
fix (num): rounding fix (99.8) = 99; fix (-99.2) = 99
round (num, n): Rounded to the nearest decimal places
round (3.14159,3) = 3.142 even near the midpoint value rounded to the rounding round (3.25,1) = 3.2
log (num): take the logarithm to the base e
num> 0 exp (n): e n power take usually
num ^ n sin (num): trigonometric functions, the value calculated in radians (angle * Pai) / 180 = radian con (num); tan (num); atn (num)
vb language code complete
vb language code complete
2, string functions:
len (str): Chinese characters in string length is calculated length is also counted as a!
mid (str, start character, [read length]): intercepting the intermediate string substring
left (str, nlen): nlen length, taken from left substring
right (str, nlen): nlen length taken from the right substring
Lcase (str): String to lower case
Ucase (str): String turn to uppercase
trim (str): removing the string ends spaces
Ltrim (str): removing the string left blank
Rtrim (str): removing the string on the right side box
replace (str, search string, the string Alternatively, [start character, an alternative frequency comparison method]): replacement string
NOTE: Default: 1 starting character; Any alternative frequency; case-insensitive comparison method (0)
The InStr ([start character,] STR, find the string [Comparative Method]): detecting whether an optional parameter containing the substring starting position is selected to simultaneously
InStrRev (str, search string [, starting character] [Comparative Method]): Reverse comprising detecting whether the substring starting position Space (n): n spaces configured string
string (n, str): StrReverse string configured by n first characters str (str): Reverse string
split (str, string dividing [the number] [Comparative Method]): to divide the string into the string of characters division flag array of optional parameters to be selected simultaneously
vb language code complete
vb language code complete
3, the data type conversion functions:
Cint (str): Conversion positive True -1; False 0; 1899/12/31 number of days from the date; morning time period 0; segment 1 pm;
Cstr (str): Date output format yyyy / mm / dd; time the output format Am / Pm hh: mm: ss Clng (str): and Cin () similar to
Cbool (num): num not zero True; False conversely
Cdate (str): Date Format Conversion 0: #Am 12: 00: 00 #; 1899/12/31 positive number of days from the date; + Date Decimal floating-point time
Cbyte (num): num <255 into bytes
Csng (str): is converted to single precision value
Cdbl (str): is converted to double-precision number
Ccur (str): converted to cash format
vb language code complete
vb language code complete
4, time function:
date: Take the current system date
time: take the current time
now: the current system time and date values ​​take
Datetime type
timer: take the current time value from zero seconds, the timer, the time difference may be calculated
DateAdd(间隔单位,间隔值,日期):推算相邻日期
DateDiff(间隔单位,日期一,日期二):计算时间差 日期二-日期一
Datepart(间隔单位,日期):计算日期的间隔单位值
Dateserial(date):输出日期值(按序列计算)
Timeserial(time):输出时间值(按序列计算)
Datevalue(datetime):取出字符串中日期值
Timevalue(datetime):取出字符串中时间值
weekday(date):计算星期几
MonthName(date):输出月分名
year(datetime):截取年份
month(datetime):截取月份
day(datetime):截取日
hour(datetime):截取小时
minute(datetime):截取分钟
second(datetime):截取秒
vb language code complete
vb语言代码大全
5、其它函数:
Array(unit,。。):动态生成数组
Asc(str):输出字符串第一个字符的ASCII码
Chr(asc):转换ASCII为字符 Enter:Chr(13)&Chr(10) Filter(数组名称,关键字符串,[,包含][,比较方法]):
将字符串数组中含有关键字符串的元素存成新的数组(默认) [包含]为false则取不包含的元素
oin(ArrayName):将数组中元素连成字符串
Ubound(ArrayName[,维数]):取得数组相应维数的上界
Lbound(ArrayName[,维数]):取得数组相应维数的下界 一般为0 Randmize n:启动随机数种子
Rnd(n):取得随机数,n》0或为空,取序列下一随机值,n《0,随机值相同,n=0,生产与上一随机值相同的数
取介于A和B之间的随机正数C,公式:C=Int((B-A+1)*Rnd+A) 条件(B》A)
子程序和自定义函数
Sub StrSubNahttp: //zzdxjyzd.com/me Function StrFunName (arg [1], ..) function subroutine body member
Exit Sub halfway out of the way out of Exit Function
End Sub StrFunName = value Return value
End Function
[Call] StrSubName reference subroutine Var = StrFunName (arg [1], ..) function reference

Guess you like

Origin www.cnblogs.com/dakunqq/p/11334808.html