1 / 17

Replace(expression, find, replacewith [ , compare [ , count [ , start ]]] )

常用函数的使用:. Replace(expression, find, replacewith [ , compare [ , count [ , start ]]] ). 功能:返回字符串, 其中指定数目的某子字符串被替换为另一个子字符串。. LTrim 、 RTrim 和 Trim 函数 描述 返回不带前导空格 (LTrim) 、后续空格 (RTrim) 或前导与后续空格 (Trim) 的字符串副本。 语法 LTrim(string) RTrim(string) Trim(string).

manchu
Download Presentation

Replace(expression, find, replacewith [ , compare [ , count [ , start ]]] )

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. 常用函数的使用: Replace(expression,find, replacewith[,compare[,count[,start]]]) 功能:返回字符串, 其中指定数目的某子字符串被替换为另一个子字符串。

  2. LTrim、RTrim 和 Trim 函数 描述 返回不带前导空格 (LTrim)、后续空格 (RTrim) 或前导与后续空格 (Trim) 的字符串副本。 语法 LTrim(string) RTrim(string) Trim(string)

  3. Mid(string, start[, length])

  4. Left(string, length)

  5. Right(string, length)

  6. LCase(string):返回字符串的小写形式。 UCase(string):返回字符串的大写形式。

  7. InStr([start, ]string1, string2[, compare]) 功能:返回某字符串在另一字符串中第一次出现的位置。

  8. InStr([start, ]string1, string2[, compare])

  9. 变量类型转换: Asc(string): 返回与字符串的第一个字母对应的 ANSI 字符代码。 Dim MyNumber MyNumber = Asc(“A”) ‘返回 65。 MyNumber = Asc(“a”) ‘返回 97。 MyNumber = Asc("Apple") '返回 65。

  10. 变量类型转换: CBool(expression) 返回表达式,此表达式已转换为 Boolean子类型的 Variant Dim A, B, Check A = 5: B = 5 ‘初始化变量。 Check = CBool(A = B) ‘复选框设为 True 。 A = 0 ‘定义变量。 Check = CBool(A) '复选框设为 False 。

  11. 变量类型转换: CDbl(expression) expression 参数是任意有效的表达式。 返回表达式,此表达式已被转换为 Double子类型的 Variant。 Dim MyCurr, MyDouble MyCurr = CCur(234.456784) ‘ MyCurr 是 Currency 型 (234.4567)。 MyDouble = CDbl(MyCurr * 8.2 * 0.01) ' 把结果转换为 Double 型 (19.2254576)。

  12. 变量类型转换: Chr 函数 返回与指定的 ANSI 字符代码相对应的字符。 Dim MyChar MyChar = Chr(65) ‘返回 A。 MyChar = Chr(97) ‘返回 a。 MyChar = Chr(62) ‘返回 >。 MyChar = Chr(37) '返回 %。

  13. 变量类型转换: CInt(expression) 返回表达式,此表达式已被转换为 Integer子类型的 Variant。 Dim MyDouble, MyInt ,Mstring MyDouble = 2345.5678 ‘ MyDouble 是 Double。 Mstring=“123456” MyInt = CInt(MyDouble) ‘ MyInt 包含 2346。 MyInt=Cint(Mstring) ‘MyInt为123456

  14. 变量类型转换: CStr(expression) expression参数是任意有效的表达式。 返回表达式,该表达式已被转换为 String子类型的 Variant。 expression CStr 返回 Boolean字符串, 包含 True或 False。 Date字符串, 包含系统的短日期格式日期。 Null 运行时错误。 Empty 零长度字符串(“”)。 Error 字符串,包含跟随有错误号码的单词 Error。 其他数值字符串, 包含此数字。

  15. 变量类型转换: Dim MyDouble, MyString MyDouble = 437.324 ‘ MyDouble 是双精度值。 MyString = CStr(MyDouble) ' MyString 包含 "437.324"。

  16. Eval函数的功能 Eval(string):动态执行string包含的命令。 Eval(“1*2+3”) 返回5 Eval(“a=b”) 返回根据a,b值的比较得出得真假值 Eval(“a=123”) 给变量a赋值123

More Related