abs(num): returns absolute value
sgn(num): num> 1; num= ; num< -1; Judging whether the numerical value is positive or negative
hex(num): Returns a hexadecimal value directly indicating:&; Hxx maximum 8 digits
oct(num): returns an octal value, which directly indicates:&; Maximum 8 digits of Oxx
sqr(num): returns the square root num >;
int(num): integer int(99.8)=99; Int(-99.2)=1
fix(num): integer fix(99.8)=99; Fix(-99.2)=99
round(num,n): round to the decimal place round(3.14159,3)=3.142; round to the nearest integer round(3.25,1)=3.2
log(num): round to the logarithm num & with the base of E.
exp(n): to take the nth power of e, it is usually a trigonometric function with num n
sin (num), which is calculated by radian (angle *Pai)/18= radian con(num); tan(num); Atn(num)
2. String function:
len(str): the length of Chinese characters is also counted as one!
mid(str, start character, [read length]): intercepting the middle substring of the string
left(str,nlen): intercepting the nlen length substring
right(str, Nlen): truncate the nlen length substring
Lcase(str): convert the string to lowercase
Ucase(str): convert the string to uppercase
trim(str): remove the spaces at both ends of the string
Ltrim(str): remove the spaces at the left side of the string
Rtrim(str). : remove the space on the right side of the string
replace(str, search string, substitute string, [starting character, substitution times, comparison method]): replace the string
Note: default value: starting character 1; The number of substitutions is not limited; The comparison method is case-sensitive ()
InStr([ start character, ]str, search string [,comparison method]): to detect whether there is a substring optional parameter, you need to select the return start position
InStrRev(str, search string [,start character] [, Comparison method]): reversely detect whether it contains substring and return to the starting position
space(n): construct a string with n spaces
string(n,str): construct a string consisting of the first characters of n STRs
strverse (str): invert the string
split(str, split string [,number of times] [, Comparison method]): The optional parameter of converting a character string into a character array with the split character string as the split flag needs to be selected at the same time
3. Data type conversion function:
Cint(str): converting a positive number to true-1; False ; Date distance is 1899/12/31 days; Time : am: Afternoon segment 1;
Cstr(str): date output format yyyy/mm/DD; Time output format Am/Pm hh:mm:ss
Clng(str): similar to Cin ()
cbool (num): num is not zero True;; On the contrary, False
Cdate(str): convert date format : # am12: : #; Positive number of days from 1899/12/31; Floating-point date+decimal time
cbyte (num): num <; 255 converted to byte
Csng(str): converted to single-precision value
Cdbl(str): converted to double-precision value
Ccur(str). : Convert to cash format
4. Time function:
date: Take the current date of the system
time: Take the current time of the system
now: Take the current time and date value of the system Datetime type
timer: Take the zero second value of the current time distance, timer, and calculate the time difference
DateAdd (interval unit, interval value, Date): calculate the adjacent date
DateDiff (interval unit, date one, date two): calculate the time difference date two-date one
Datepart (interval unit, Date): interval unit value of calculating date
Dateserial(date): output date value (calculated by sequence)
Timeserial(time): output time value (calculated by sequence)
Datevalue(datetime): fetch the date value
Timevalue(datetime) from the string. : take out the time value
weekday(date) in the string: calculate the day of the week
MonthName(date): output month minute name
year(datetime): interception year
month(datetime): interception month
day(datetime): interception day
hour (. : intercept hour
minute(datetime): intercept minute
second(datetime): intercept second
5. Other functions:
Array(unit, ...): dynamically generate array
Asc(str): output the ASCII code of the first character of the string
chr (. Chr(1)
Filter (array name, key string, [,including] [,comparison method]):
Save the elements containing key strings in the string array into a new array (default). If [including] is false, take the elements that are not included
oin(ArrayName): connect the elements in the array into a string
uboun. Dimension]): get the upper bound of the corresponding dimension of the array
Lbound(ArrayName[, dimension]): get the lower bound of the corresponding dimension of the array generally
Randmize n: start the random number seed
Rnd(n): get the random number, n >; or empty, take the n< random value in the sequence, n <; , the random value is the same, n=, and the number that is the same as the last random value is produced
Take a random positive number C between A and B, and the formula is: C=Int((B-A+1)*Rnd+A) condition (b >; A)
subroutine and user-defined function
substrsubname function strfunname (arg [1], ..)
subroutine body function body
Exit Sub jumps out of Exit Function
end sub strfunname = value returns value
end function
[call] strfunname references subroutine Var=StrFunName(arg[1], ..) references function.