vfp常用函数汇总表
- 格式:doc
- 大小:136.00 KB
- 文档页数:20
VFP常用函数总汇VFP常用函数总汇VFP常用函数使用说明1、数值运算函数函数操作例结果SQRT(x) 求平方根 SQRT(9) 3INT(x) 取整数 INT(3.14) 3ROUND(x) 四舍五入 ROUND(3.14159,4) 3.1416MOD(x,y) 求X除以Y的余数 MOD(25,4) 1MAX(x,y) 求X,Y中的最大值 MAX(7,8) 8MIN(x,y) 求X,Y中的最小值 MIN(1,2,3) 12、字符中操作函数函数名操作例结果UPPER(S)小写字母 UPPER(abc) ABCLOWER(S)大写字母 LOWER(ACD) acdLEN(S)求字符串的长度 LEN("中国1号") 7AT(S1,S2)在字符串S2,找字符串S1 AT("H","CHINA") 2SUBSTR(S,I,N)在S字符串中的第I个字符起取N个字符SUBSTR('TECHNOLO',3,3) CHNLEFT(S,N)从字符串S左边取N个字符 LEFT(“中国人”,4)中国RIGHT(S,N)从字符串S右边取N个字符S=‘12345’RIGHT(S,3) 345SPACE(N)生成N个空格 "合计"+SPACE(2)+"123" 合计123 TRIM(S)消除字符串尾部空格 TRIM("姓名 ") 姓名ALLTRI(S)消除字符串中所有空格 ALLTRIM("李丽")李丽STUFF(S1,N1,N2,S2) 用字符串S2替换S1中第N1个字符起的N2个字符 STUFF("NOW",2,1,"E") NEW& 宏替换P=“G2”USE &P USE G23、日期和时间函数函数名操作例结果DATE()求当前日期 DATE() 2001/11/12DATETIME() 求当前日期和时间 DATETIME() 2001/11/12/0:22:33amYEAR(D)求年份 YEAR(DATE()) 2001MONTH(D)求月份(数值) MONTH(DATETIME()) 11CMONTH(D)求月份(字符)MONTH(DATETIME()) NovenberDAY(D)求日期 DAY(DATE()) 12DOW(D)求星期几(数值) DOW(DATE()) 1CDOW(D)求星期几(英文) CDOW(DATE()) sundayTIME(D)求当前时间 TIME(DATE()) 10:20:38am4、数据类型转换函数函数名操作例结果ASC(S)求第一个字符串的ASCII码 ASC("what") 87CHR(N)求ASCII码的字符 CHR(87) wSTR(R,L,D) 数值转换成字符,L为长度,D为小数位数 X=3.1415STR(X,6,2) 3.14VAL(S)字符串转换为数值 VAL("123") 123.00CTOD(S)字符串转日期 CTOD('11/01/2002') 11/01/2002DTOC(D)日期转换成字符串 DTOC(DATE()) 11/01/2002DTOS(D)把日期转成年月日式的字符串DTOS(DATE()) 20021101CTOT(C)字符串转成日期时间型CTOT(11/01/2002 10:30:50am) 11/01/2002 10:30:50amDTOT(D)日期型转为日期时间型DTOT(DATE()) 11/25/2001 00:00:01amTTOC(T)日期时间型转为字符型TTOC(DATETIME()) 11/25/2001 00:00:01amTTOD(T)日期时间型转为日期型TTOD(DATETIME()) 11/25/2001IIF(LE,E1,E2) 逻辑判断 IIF(A>0,"YES","NO") YES5、检测函数函数名操作例结果RECNO()检测当前记录号 RECNO() 1RECCOUNT()检测当前记录数 RECCOUNT() 12BOF()开始记录 BOF() 1EOF()最后记录 EOF() 12FOUND()返回查找结果 FOUND() .T.ROW()返回当前行坐标 ROW() 1COL()返回当前列坐标 COL() 1SYS(N)返回系统状态 SYS(13)联机状态。
Visual FoxPro常用函数分类表2008-02-16 19:44VisualFoxPro磁盘_目录_文件函数ADIR()将文件信息存放到数组中,然后返回文件个数。
CURDIR()返回当前目录或文件夹。
DEFAULTEXT()如果一个文件没有扩展名,则返回一个带新扩展名的文件名。
DIRECTORY()若在磁盘上存在指定的目录,返回真(.T.)。
DISPLAYPATH()为显示而截去长路径名到指定长度。
DRIVETYPE()返回指定驱动器的类型。
FDATE()返回文件最近一次修改的日期或日期时间。
FILE()如果在磁盘上找到指定的文件,则返回“真”(.T.)。
FILETOSTR()将一个文件的内容返回为一个字符串。
FORCEEXT()返回一个字符串,使用新的扩展名替换旧的扩展名FORCEPATH()返回一个文件名,使用新路径名代替旧文件名FTIME()返回最近一次修改文件的时间。
FULLPATH()返回指定文件的路径或相对于另一文件的路径。
GETDIR()显示“选择目录”对话框,从中可以选择目录或文件夹。
GETFILE()显示“打开”对话框,并返回选定文件的名称。
JUSTDRIVE()从完整路径中返回驱动器的字母。
JUSTEXT()从完整路径中返回三字母的扩展名。
JUSTFNAME()返回完整路径和文件名中的文件名部分。
JUSTPATH()返回完整路径中的路径名。
JUSTTEM()返回完整路径和文件名中的根名(扩展名前的文件名)。
LOCFILE()在磁盘上定位文件并返回带有路径的文件名。
PUTFILE()激活“另存为…”对话框,并返回指定的文件名。
STRTOFILE()将一个字符串的内容写入一个文件。
SYS(3)返回一个合法文件名,可用来创建临时文件。
SYS(5)返回当前VisualFoxPro的默认驱动器。
SYS(7)返回当前格式文件的名称。
SYS(2000)返回一个按字母排序的与文件名和扩展名梗概匹配的第一个文件名。
vfp表常用函数基本操作:1、新建数据库命令:CREATE <文件名>2、打开数据库命令:USE <文件名>3、浏览数据库命令:BROWSE4、查找记录命令:LOCATE 例:Loca all for 性别=’女’Loca all for 工资>160.00 .AND. 工资<180.00常和继续查找命令CONTINUE连用。
FIND 例:find <字符串>/使用前需要先排序。
SEEK 例:seek <表达式>表达式是字符串时,必须用“”引起来。
如seek “卫明”5、增加库记录命令:APPEND &&增加记录命令APPEND BLANK &&增加一条空记录APPEND FROM <文件名> [FOR<表达式>] &&从一个文件复制记录到现行数据库中6、插入记录命令INSERT格式:insert [blank] [before]use <文件名>go 5insert before7、库记录的删除DELETE格式:DELETE [<范围>] [FOR<表达式>] [WHILE<表达式>]功能:给符合条件的库记录加上删除标记。
例:delete all for 性别=’女’PACK格式:PACK功能;把打开的数据库文件中作过删除标记的记录真正删除掉。
ZAP格式:ZAP功能;从打开的数据库文件中删除所有记录8、恢复命令RECALL格式;RECALL [<范围>] [FOR<表达式>] [WHILE<表达式>]功能;恢复打开的数据库文件中带有删除标记的记录9、库记录的修改EDIT格式:EDIT [<范围>] [FIELDS<字段名表>] [FOR<表达式>] [WHILE<表达式>]CHANGE格式:CHANGE [<范围>] [FIELDS<字段名>] [FOR<表达式>] [WHILE<表达式>]BROWSE格式:BROWSE [FIELDS<字段名>] [LOCK<表达式>] [FREEZE<字段名>]10、替换命令REPLACE格式;REPLACE [<范围>] <字段名1> WITH <表达式1> [,<字段名2> WITH<表达式2>…] [FOR<表达式>] [WHILE<表达式>]功能:用来替换打开的数据库文件中指定字段的数据。
函数①、数值型函数1.绝对值函数【函数格式】?abs(<数值表达式> )【函数功能】返回指定“数值表达式”的绝对值【返回值类型】数值型eg:?abs(-1) 12.平方根函数【函数格式】?sqrt(<数值表达式>)【函数功能】返回指定“数值表达式”值的平方根。
“数值表达式”的值必须是大于或等于零【返回值类型】数值型eg:?sqrt(25) 5?sqrt(81) 9?sqrt(7^2-4*2*4) 4.123.取整函数【函数格式】?int(<数值表达式>)【函数功能】返回指定“数值表达式”整数部分的值【返回值类型】数值型eg:?int(6489.658) 6489?int(123.58) 1234.四舍五入函数【函数格式】?round(<数值表达式1>,<数值表达式2>)【函数功能】对指定的<数值表达式1>进行四舍五入运算【使用说明】<数值表达式2>指定四舍五入运算精确的位数。
如果“数值表达式2”是正整数,它指定保留的小数位数;如果“数值表达式2”是0,它指定精确到个位;如果“数值表达式2”是负整数,它指定精确的整数位数【返回值类型】数值型eg:?round(678.657,0) 679?round(678.657,3) 678.657?round(678.657,-1) 6805.求余函数【函数格式】?mod(<数值表达式1>, <数值表达式2>)【函数功能】求<数值表达式1>除以<数值表达式2>后的模【使用说明】若两参数的值大于0,则模为余数;若两参数一正一负,则模为余数与“数值表达式2”之和;若两参数均为负,则模为余数取反。
遵循的原则:一、模的符号与表达式2的相同;二、余数的绝对值小于除数(<表达式2>)的绝对值【返回值类型】数值型eg:?mod(10,3) 1?mod(13,-4) -3?mod(12.7,2.2) 1.76. e次方函数【函数格式】?exp(<数值表达式>)【函数功能】返回e x的值(x为<数值表达式>)【返回值类型】数值型eg:?exp(1) 2.727.最大值函数【函数格式】?max(<表达式1>, <表达式2>…)【函数功能】返回各个表达式中的最大值。
常用函数一.数值函数1.绝对值和符号函数ABS(<数值表达式>)返回指定的数值表达式的绝对值SIGN (<数值表达式) 返回指定数值表达式的符号, 当表达式的运算结果为正负和零时,函数值分别为1,-1,0 P612.求平方根函数SQRT(<数值表达式>)返回指定表达式的平方根, 自变量表达式的值不能为零. P61 3.圆周率函数PI( ) 返回圆周率π(数值型),该函数没有自变量。
P614.求整数函数INT (<数值表达式>)返回指定数值表达式的整数部分CEILING (<数值表达式>) 返回大于或等于指定数值表达式的最小整数FLOOR (<数值表达式>) 返回小于或者等于指定数值表达式的最大整数P625.四舍五入函数ROUND (<数值表达式1>,<数值表达式2>) 返回表达式在指定位置四舍五入后的结果。
<数值表达式2>指明四舍五入的位置,若<数值表达式2>大于等于0,那么它表示的是要保留的小数位数;若<数值表达式2>小于0,那么他表示的是整数部分的舍入位数。
P626.求余数函数MOD(<数值表达式1>,<数值表达式2>)返回两个数值相除后的余数,<数值表达式1>是被除数,<数值表达式2>除数。
余数的正负号与除数相同,如果被除数和除数同号,那么函数值为两数相除的余数,如果被除数和除数异号,则函数值为两数相除的余数再加上除数的值。
P627.求最大值和最小值MAX (<数值表达式1>,<数值表达式2>)[,<数值表达式3>……] 计算各自变量表达式的值,并返回其中的最大值。
MIN (<数值表达式1>,<数值表达式2>)[,<数值表达式3>……] 计算各自自变量表达式的值,并返回其中的最小值。
一、数值函数数值函数用于数值运算,其自变量与函数都是数值型数据。
1.取绝对值函数ABS( )【格式】ABS(<nExp>)【功能】计算nExp的值,并返回该值的绝对值。
2.指数函数EXP( )【格式】EXP(<nExp>)【功能】求以e为底、nExp值为指数的幂,即返回ex的值。
3.取整函数INT( )【格式】INT(<nExp>)【功能】计算nExp的值,返回该值的整数部分。
4.上界函数CEILING( )【格式】CEILING(<nExp>)【功能】计算nExp的值,返回一个大于或等于该值的最小整数。
5.下界函数FLOOR( )【格式】FLOOR(<nExp>)【功能】计算nExp的值,返回一个小于或等于该值的最大整数。
6.自然对数函数LOG( )【格式】LOG(<nExp>)【功能】求nExp的自然对数。
nExp的值必须为正数。
7.常用对数函数【格式】LOG10(<nExp>)【功能】求nExp的常用对数。
nExp的值必须为正数。
8.平方根函数SQRT( )【格式】SQRT(<nExp>)【功能】求非负nExp的平方根。
9.最大值函数MAX( )和最小值函数MIN( )【格式】MAX(<nExp1>,< nExp2>[,< nExp3>...])MIN(<nExp1>,< nExp2>[,< nExp3>...])【功能】返回数值表达式中的最大值MAX( )和最小值MIN( )。
10.求余数函数MOD( )【格式】MOD(<nExp1>,<nExp2>)【功能】返回nExp1除以nExp2的余数。
余数的小数位数与nExp1相同,符号与nExp2相同。
11.四舍五入函数ROUND( )【格式】ROUND(<nExp1>,< nExp2>)【功能】返回nExp1四舍五入的值,nExp2表示保留的小数位数。
VisualFoxPro磁盘_目录_文件函数ADIR()将文件信息存放到数组中,然后返回文件个数。
CURDIR()返回当前目录或文件夹。
DEFAULTEXT()如果一个文件没有扩展名,则返回一个带新扩展名的文件名。
DIRECTORY()若在磁盘上存在指定的目录,返回真(.T.)。
DISPLAYPA TH()为显示而截去长路径名到指定长度。
DRIVETYPE()返回指定驱动器的类型。
FDATE()返回文件最近一次修改的日期或日期时间。
FILE()如果在磁盘上找到指定的文件,则返回“真”(.T.)。
FILETOSTR()将一个文件的内容返回为一个字符串。
FORCEEXT()返回一个字符串,使用新的扩展名替换旧的扩展名FORCEPATH()返回一个文件名,使用新路径名代替旧文件名FTIME()返回最近一次修改文件的时间。
FULLPATH()返回指定文件的路径或相对于另一文件的路径。
GETDIR()显示“选择目录”对话框,从中可以选择目录或文件夹。
GETFILE()显示“打开”对话框,并返回选定文件的名称。
JUSTDRIVE()从完整路径中返回驱动器的字母。
JUSTEXT()从完整路径中返回三字母的扩展名。
JUSTFNAME()返回完整路径和文件名中的文件名部分。
JUSTPATH()返回完整路径中的路径名。
JUSTTEM()返回完整路径和文件名中的根名(扩展名前的文件名)。
LOCFILE()在磁盘上定位文件并返回带有路径的文件名。
PUTFILE()激活“另存为…”对话框,并返回指定的文件名。
STRTOFILE()将一个字符串的内容写入一个文件。
SYS(3)返回一个合法文件名,可用来创建临时文件。
SYS(5)返回当前VisualFoxPro的默认驱动器。
SYS(7)返回当前格式文件的名称。
SYS(2000)返回一个按字母排序的与文件名和扩展名梗概匹配的第一个文件名。
SYS(2003)返回默认驱动器或卷上的当前目录或文件夹的名称。
VFP函数大全VFP函数大全%运算符用于计算并返回两个数值表达式相除之后的余数$(包含)运算符用于进行字符表达式之间的包含关系运算,如果一个字符表达式包含在另一个字符表达式之中,则函数返回真ABS() 计算并返回指定数值表达式的绝对值ACLASS() 用于将一个对象的父类名放置于一个内存数组中ACOPY() 把一个数组的元素拷贝到另一个数组中ACOS() 计算并返回一个指定数值表达式的余弦值ADATABASES() 用于将所有打开的数据库名和它的路径存入一个内在变量数组中ADB OBJECT S() 用于把当前数据库中的连接、表或SQL视图的名存入内存变量数组中ADEL() 用于从一维数据中删除一个元素,或从二维数组中删除一行或者一列元素ADIR() 将文件的有关信息存入指定的数组中,然后返回文件数AELEMENT() 通过元素的下标,返回元素号AFIELDS 将当前的结构信息存入数组中,然后返回表中的字段数AFONT() 将可用字体的信息存入数组中AERROR() 用于创建包含VFP或ODBC错误信息的内存变量AINS() 在一维数组中插入一个元素或在二维数组中插入一行或一列元素AINSTANCE() 用于将类的所有实例存入内存变量数组中,然后返回数组中存放的实例数ALEN() 返回数组中元素、行或者列数ALIAS() 返回当前工作区或指定工作区内表的别名ALLTRIM() 从指定字符表达式的首尾两端删除前导和尾随的空格字符,然后返回截去空格后的字符串AMEMBERS() 用于将对象的属性、过程和成员对象存入内存变量数组中ANSITOOEM() 将指定字符表达式中的每个字符转换为MS-DOS (OEM)字符集中对应字符APRINTERS() 将Print Manager中安装的当前打印机名存入内存变量数组中ASC() 用于返回指定字符表达式中最左字符的ASCII码值ASCAN() 搜索一个指定的数组,寻找一个与表达式中数据和数据类型相同的数组元素ASELOBJ() 将活动的Form设计器当前控件的对象引用存储到内存变量数组中ASIN() 计算并返回指定数值表达式反正弦值ASORT() 按升序或降序排列数组中的元素ASUBSCRIPT() 计算并返回指定元素号的行或者列坐标AT() 寻找字符串或备注字段在另一字符串或备注字段中的第一次出现,并返回位置ATAN() 计算并返回指定数值表达式的反正切值ATC() 寻找字符串或备注字段中的第一次出现,并返回位置,将不考虑表达式中字母的大小写ATCLINE() 寻找并返回一个字符串表达式或备注字段在另一字符表达式或备注字段中第一次出现的行号。
vfp函数大全(VFP function Daquan)Visual foxpro数据库函数Adatabases () 将所有打开数据库的名称和路径放到内存变量数组中Adbobjects () 把当前数据库中的命名连接名、关系名、表名或sql 视图名放到一个内存变量数组中Afields () 把当前表的结构信息存放在一个数组中, 并且返回表的字段数返回当前表或指定工作区衰的别名 (alias)Asessions () 创建一个已存在的数据工作期id数组Ataginfo () 创建一个包含索引和键表达式的名字、数量和类型信息的数组Aused () 将一个数据工作期中的表别名和工作区存入内存变量数组确定当前记录指针是否在表头 BOF ()判断索引是否为候选索引 (candidate)根据指定的索引位置编号 (CDX), 返回打开的复合索引 (CDX) 文件名称Cpdbp () 返回一个打开表所使用的代码页Createoffline () 由已存在的视图创建一个游离视图Cursorgetprop () 返回visualfoxpro表或临时表的当前属性设置Cursorsetprop () 指定visualfoxpro表或临时表的属性设置Cursortoxml () 转换visualfoxpro临时表为xml文本从磁盘上的表或远程数据源中直接返回字段值 Curval ()返回当前数据库的名称和路径 (DBC)返回指定工作区中打开的表名 (DBF), 或根据表别名返回表名Dbsetprop () 给当前数据库或当前数据库中的字段、命名连接、表或视图设置一个属性返回一个表明当前记录是否标有删除标记的逻辑值 (deleted)是否用descending关键字创建了一个索引标识 (Descending)Dropoffline () 放弃对游离视图的所有修改, 并把游离视图放回到数据库中确定记录指针位置是否超出当前表或指定表中的最后一个记录 EOF ()Fcount () 返回衰中的字段数目根据编号返回表中的字段名 (FIELD)返回setfilter命令中指定的表筛选表达式 (Filter)Fldlist () 对于setmelds命令指定的字段列表, 返回其中的字段和计算结果字段表达式尝试锁定当前表或指定表 flock ()For 返回一个己打开的单项索引文件或索引标识的索引筛选表达式()如果continue、find、locate或seek命令执行成功 found (), 函数的返回值为 "真"(以字节为单位, 返回指定字段或文件的大小 fsize)Getfldstate () 返回一个数值, 标明表或临时表中的字段是否已被编辑, 或是否有追加的记录, 或者记录的删除状态是否已更改Getnextmodified () 返回一个记录号, 对应于缓冲表或临时表中下一个被修改的记录返回当前或指定表文件的表头所占的字节数 (header)(IDXCOLLATE) sequence returns the index or index mark(INDBC) if the specified database object in the current database, returns true (.T.)(INDEXSEEK) in search of a record first appeared in an indexed table(ISEXCLUSIVE) to determine whether a table or database is openin exclusive mode(ISFLOCKED) return to the locked table(ISREADONLY) to determine whether the table open in read-only mode(ISRLOCKED) locked return records(KEY) index keyword expression returns the index mark or index file(KEYMATCH) search a keyword index in the index or index file(LOOKUP) the search field value with the specified expression, the first record in the tableLUPDATE () returns a date table last updatedMDX (.CDX) according to the composite index file number specified index return open nameMEMLINES () returns the number of rows in the memo fieldMLINE () returns the specified row in the memo field in string formNDX () returns for the current table or an index table to open the specified file name (JDX)ORDER () returns the current table or the specified table masterindex file or logo(PRIMARY) check index, if the main index, it returns "true" (.T.)RECCOUNT () returns the specified number or record in the tableRECNO () returns the current table or specify the current record number in the tableRECSIZE () returns the size for the record in the table (width)(REFRESH) refresh the data in the SQL view can be updated inRELATION () returns the expression specified for a given open workspace in the table(SEEK) in an indexed table in the search for the first time the position of a record(SELECT) the maximum number returned number or use the current workspace workspace(SETFLDSTATE) for a table or a temporary table in the field or record the specified field state value or delete state value(SQLCANCEL) request to cancel an executing SQL statements(SQLCOLUMNS) to specify the data source table column name and information on each column is stored in a temporary table in VisualFoxPro(SQLCOMMIT) submitted a transaction(SQLCONNECT) to establish a connection to the data source(SQLDISCONNECT) to terminate the connection with the data source(SQLEXEC) will be sent to a SQL statement in the source data processing(SQLGETPROP) returns an active connection the current settings or default settings(SQLMORERESULTS) if there is more than one set of results, will be another set of results copied to a temporary table in VisualFoxPro(SQLPREPARE) in the use of SQLEXEC () to perform remote data before operation, you can use this function to make the remote data ready for the command to execute(SQLROLLBACK) cancel any changes made during the current transaction(SQLSETPROP) specify a set of active connections(SQLSTRINGCONNECT) connection using a connection string and a data source(SQLTABLES) the data source table name stored in the temporarytable in VisualFoxProSYS (14) index expressionSYS (21) control index numberSYS (22) to control the name or index nameSYS (2011) returns the current workspace or record locking table locking stateSYS (2012) returns the memo field block size tableSYS (2021) screening indexSYS (2029) and returns the value corresponding to the table typeSYS (3054) Rushmore - grade optimizationTAG (.CDX) name returns the number of composite index file open, or return to the open.IDX index file nameTAGCOUNT (return) composite index file (.CDX) logo and open index file (.IDX) numberTAGNO (return) composite index file (.CDX) identification and open index (.IDX) index file(TARGET) returns a table alias, the table is specified in the INTO clause SETRELATION command relationship goals(UNIQUE) is used to test whether the only way to establish the index(UPDATED) for testing in recent READ commands, whether the data has been modified(USED) to determine whether the specified workspace opens a tableXMLTOCURSOR (XML) convert text to VisualFoxPro cursor or table----------------------------------------------Visual FoxPro date and time functions(CTOD) the character expressions into expressions date.(CDOW) returns a value from a given week date or date time expression.(CMONTH) the name of the month returns a date or a date time expressions.(CTOD) the character expressions into expressions date.CTOT () returns a date time value from a character expression.(DATE) returned by the date of the current system operating system controls, or create a compatible with the 2000 date value.(DATETIME) to date and time value returns the current date and time, or create a 2000 compatible date time value.(DAY) to return to a given date or numeric expression date and time expressions are the first few days.(DMY) a character expression from a date or date and time expression returns a "day month year" format (for example, 31 May 1995). Not abbreviated month name.(DTOC) returned by the date or the date and time expression character date.DTOS (string) returns yyyymmdd date format from the specified date or date and time in the expression.(DTOT) the return date time value from the date.(GOMONTH) for a given date or date and time expressions expressions, before or after the date of the month returns the specified number.(HOUR) return date and time expressions part hours.MDY () returns the specified date or date and time expressions to "month day year" format, which is abbreviated month name.(MINUTE) some minutes to return to date and time in the expression of type.MONTH () returns the date or date and time expressions in thevalue.QUARTER () returns a date or date and time expressions in quarter value.(SEC) part second to return to date and time in the expression of type.(SECONDS) in seconds since midnight after the return time.SYS (1) returns the current system date to date number string.SYS (2) returned since the start of the midnight time, in seconds.SYS (10) (Julian) the date will be converted into a string.SYS (11) the date format date expressions or string converted to date (Julian).(TIME) for 24 hours, the 8 string (hours: Minutes: seconds) returns the current system date and time format.(TTOC) returns a character value from the date and time expressions.TTOD () returns a date value from the date and time.WEEK () returns a value representative of the year the first few weeks from the date or date and time expressions in expression.YEAR () returns the year from the date specified in the.Visual FoxPro character function(ALLTRIM). Delete the specified character expression spaces before and afterASC () returns the leftmost characters in a character expression value of ANSIAT (return) first appeared in another character expression or memo field of a character expression or memo field locationAT_C (return) first appeared in another character expression or memo field of a character expression or memo field locationATC (return) first appeared in another character expression or memo field of a character expression or memo field locationATCC (return) first appeared in another character expression or memo field of a character expression or memo field location(ADDBS) if necessary, add a backslash to a path expressionATCLINE () returns the line number first appeared in another character expression or memo field a character expression or memo field.ATLINE () returns the line number first appeared in another character expression or memo field a character expression ormemo field.(BETWEEN) to determine the value of an expression is in between the other two expressions of the same data type valueCHR (ANSI) according to the numerical code specified the corresponding character(CHRTRAN) will replace the first character in the expression and the second expression character matching character for the corresponding character in the third expression(CHRTRANC) will replace the first character in the expression and the second expression character matching character for the corresponding character in the third expression(CPCONVERT) the character, character expression or memo field conversion to other code page(CHRSAW) to determine whether a character appears in the keyboard buffer(CHRTRAN) in a character expression, to replace the second match the expression character for the corresponding character in the third expression(CHRTRANC) will replace the first character in the expression and the second expression character matching character for the corresponding character in the third expressionDIFFERENCE () returns an integer from 0 to 4, indicatingrelative phonetic difference between expressions of two characters(EMPTY) determines whether the expression is null(GErWORDCOUNr) count a few words in(GETWORDNUM) returns a specified word from a string(INLIST) to determine whether an expression and a set of expressions in a match. '(ISALPHA) to determine the leftmost character expression whether a character is a letter(ISBLANK) to determine whether the expression of null values(ISDIGIT) determine the character expression to the left of a character is digital (0 to 9)(ISLEADBYTE) if the first byte character expression of the first character is a byte, returns true (.T.)(ISLOWER) determine the character expression the leftmost character is lowercase letters(ISMOUSE) to determine whether the computer with mouse(ISNULL) to determine whether the NULL value calculation results(ISUPPER) to determine the first character character expression is uppercase (A ~ z)(LEFT), a character from the leftmost character expression returns a specified number of characters(LEPTC) from the beginning of a character expression of a character on the left returns a specified number of charactersLEN () returns the number of characters in a character expressionLENC () returns the number of characters in the expression to the word(LIKE) to determine whether a character expression is matched with another character expression(LIKEC) to determine whether a character expression is matched with another character expression(LOWER) returns a character expression specified in lowercase letters(LTRIM) a leading space delete character specified, and then return the resulting expression(OCCURS) the number of returns in another character in the expression of a character expression(OEMTOANSI) for a character in the string expression isconverted into the corresponding ANSI character set(PADL), PADR (), PADC () by an expression that returns a character, and from the left, right or from both sides with spaces or characters to fill to the specified length of the string(PROPER) returns a string from a character expression, each string in uppercase first letterRAT (return) first appeared in another character expression or memo field within a character expression or memo field position, from the rightmost character.(RATC) returns a character expression in another character expression or memo field last appeared in the line, from the last line.(RATLINE) line number back to a character expression or memo field in another character expression or memo field appears at the end of the last line, from the start counting.(REPUCATE) returns a string, the string is the specified character expression after repeated a specified number of times(RIGHT) from the beginning of the right string returns a specified number of charactersRIGHTC () returns the right from a specified number of characters in a string(RTRIM) delete a character expression following space after return result stringSOUNDEX (voice) returns a character expression specified representation(SPACE) returns a string consisting of the specified number of spacesSTR () returns the specified numeric expression corresponding to the character(STRCONV) the character expression into another formSTREXTRACT (two) returns a string delimiter between(STRTRAN) in the first character expression or memo field search, second character expressions or memo field, and third character expression - type or memo field replace each occurrence of the second character expressions or memo field(STUFF) returns a string,This string is obtained by the number specified by another character expression to replace the existing character expression of the characters(STUFFC) returns a string, the string is the number specified by another character expression to replace the existing character expression in character, the(SUBSTR) returns a string from a given character expression or memo field(SUBSTRC) returns a string from a given character expression or memo fieldSYS (15) to replace the characters in a stringSYS (20) German text conversion(TEXTMERGE) provide an evaluation on the expression.TRIM () returns the specified character expression after delete all suffix spaces(TXTWIDTH) according to the average width of the character font return character expression length(TYPE) calculation of character expression and returns its contents, data typeUPPER () returns uppercase character expression specified----------------------------------------------Visual FoxPro numerical functionABS (absolute value) returns the specified numeric expressionACOS () returns the arccosine specified numerical value of the expression(ASIN) anyway returns a numeric expression string value radianATAN () returns the arctangent numerical value curve(ATN2) the value of the specified value returned anyway, no limit quadrant return value(BINTOC) the integer represented by binary character.BITAND (two) returns the numeric values in the AND operation by the results(BITCLEAR) refers to a clear positioning numerical numeric (this bit set to 0), and returns the result value(BITLSHIFr) returns a numeric numerical result after moving to the left to the positionBrrNOT () returns a value of type NOT according to the numerical calculation resultsBITOR (two) returns the numeric OR operation according to the numerical results(BITRSHIFF) returns a numeric value to move right after positioning results(BITSET) will be a set value of a numeric 1 and returns the result(BITTEST) to determine the value of a numeric finger positioning is 1BITXOR (two) returns the numeric numerical XOR bitwise resultsCEILING () returns the smallest integer greater than or equal to the specified numeric expressionCOS () returns the numeric expression of Yu Xianzhi(CTOmN) will be converted to an integer type representation of binary characters(DTOR) radians(EVALUATE) to calculate the value of the expression character and returns the result(EVL) a non null value from the two expressions to returnEXP () returns the value of eAx, where x is a numeric expression of a given(FLOOR) on the numerical expression of the given value, returns the largest integer less than or equal to it.FV () returns the future value of a financial investment(INT) a numerical calculation of the value of the expression, and returns the integer part(LOG) the natural logarithm returns a numeric expression (base C)(LOGl0) the common logarithm returns a numeric expression (base 10).(MAX) on the expressions, and returns the expression with maximum value(MIN) to calculate a set of expressions, and returns with the minimum value of the expression(MOD) to remove another numeric expression with a numeric expression that returns the remainder(MTON) a numeric value returned by a currency.(NORMALIZE) to provide users with a character expression can be converted to VisualFoxPro and compared the format function return value(NTOM) returned by a numeric expression containing four decimal currency value(NVL) returns a non null value from two.(PAYMENT) the number of each payment return fixed interest loan repayPI (n) returns a numeric constant(PV) the present value of an investment return(RAND) returns a random number between 0 and 1.ROUND (return) rounded to the specified numeric expression of decimal digits(RTOD) the degree of curvature into(SIGN) when the specified numeric expression value is positive, negative or 0, respectively, 1 -1 or 0 returnSIN () returns a value of the sine angle.SQRT () returns the square root of the specified numeric expressionSYS (2007) returns a character expression check sum valueTAN () returns the value of the tangent angle(VAL) a character expression consists of digits return numeric values----------------------------------------------FTP://********************.net find the help9.chm file in the FTPThis is a function of vfp9.0 command manual contains all command function vfp.You can also join the QQ group VFP heaven:Nineteen million thirty-nine thousand one hundred andthirty-nineNineteen million six hundred and forty-four thousand six hundred and ninety-twoTwenty million one hundred and forty-nine thousand eight hundred and ninety-threeTwenty-one million seven hundred and nine thousand six hundred and twentyThe inside of the master can meet all your questions。
Visual FoxPro常用函数汇总表
函数分类
1、数学函数
函数用途
ABS(<数值表达式>)绝对值,|x|
CEILING(<数值表达式>) >=自变量的最小整数
EXP(<数值表达式>)对基E的幂,e=2.71828 FLOOR(<数值表达式>) <=自变量的最大整数
INT(<数值表达式>)取整(舍尾)自变量
LOG(<数值表达式>)自变量的自然对数,ln x LOG10(<数值表达式>)自变量的普通对数,lg x MAX(<表达式1>,<表达式2>)两个值的最大值MIN(<表达式1>,<表达式2>)两个值的最小值MOD(<数值表达式1>,<数值表达式2>)求余数
RAND([<数值表达式1>])返回伪随机数
ROUND(<数值表达式1>,<数值表达式2>)四舍五入第一个自变量
SIGN(<数值表达式>)自变量的符号
SQRT(<数值表达式>)平方根(正根)
2、字符串操作函数
函数用途
&<内存变量> 用于代替内存变量内容
LEN(<字符串表达式>)返回字符串表达式的字符个数
SPACE(<数值表达式>)生成空格
SUBSTR(<字符串表达式>,<数值表达式n>[,<数值表达式L>])求子字符串,从指定的字符串表达式第n个开始,总长为L的字符串
LOWER(<字符串表达式>)将字符串字母转换成小写字母
UPPER(<字符串表达式>)将字符串字母转换成大写字母
TRIM(<字符串表达式>)删除字符串尾空格
ASC(<字符串表达式>)返回字符串表达式最左边的第一个字符的ASCII码
CHR(<数值表达式>)将数值表达式转换成字符
AT(<字符串表达式1>,<字符串表达式2>[,<数值表达式n>])确定字符串表达式1在字符串表达式2中的位置,n为字符串表达式第几次出现
STR(<数值表达式>[,<数值表达式L>][,<数值表达式n>)将数值转换为字符串,L为数值表达式总长,n为小数位数
VAL(<字符串表达式>)将数字字符串转换为数字
TYPE(<表达式>)检测表达式值的数据类型
LTRIM(<字符串表达式>)删除字符串左部空格
RTRIM(<字符串表达式>)删除字符串右部空格
LEFT(<字符串表达式>,<数值表达式n>)取字符串左边部分字符,n为返回的字符个数RIGHT(<字符串表达式>,<数值表达式n>)取字符串右边部分字符,n从右边截取字符个数
3、表(.dbf)操作函数
函数用途
BOF([<工作区号或别名>])查表文件开始函数
EOF([<工作区号或别名>])表文件结尾测试函数
RECNO([<工作区号或别名>])测试当前或指定工作区表的当前记录号
DELETED([<工作区号或别名>])记录删除测试函数
FILE(<"字符串">)测试文件是否存在函数
DBF([<工作区号或别名>])检测表的文件名函数
4、日期、时间函数
函数用途
DATE()查系统当前日期函数
TIME([<数值表达式>])查系统当前时间函数
YEAR(<日期型表达式>|<日期时间型表达式>)由日期查年函数
MONTH(<日期型表达式>|<日期时间型表达式>)从日期查月份函数
CMONTH(<日期型表达式>|<日期时间型表达式>)由日期查月份名函数
DAY(<日期型表达式>|<日期时间型表达式>)从日期查当月的日函数
DOW(<日期型表达式>|<日期时间型表达式>[,<数值表达式>])由日期查星期函数
CDOW(<日期型表达式>|<日期时间型表达式>)从日期查星期名函数
DTOC(<日期型表达式>|<日期时间型表达式>)日期转换为字符函数
CTOD(<字符串表达式>)字符串转换为日期函数
CTOT(<字符串表达式>)返回日期时间值函数
TTOC(<日期时间型表达式>)返回字符值
5、显示、打印位置函数
函数用途
ROW()判断光标行位置函数
COL()判断光标列位置函数
INKEY([<数值表达式>])检测用户所击键对应的ASCII码函数,数值表达式以秒为单位等待击键的时间
6、其他函数
函数用途
DISKSPACE()返回默认磁盘驱动器中可用字节数函数
OS()检测操作系统名称的函数
VERSION()返回VFP版本号的函数。