at函数的用法

2024-10-31 16:20:31
at函数的用法,在线求解答
写回答

最佳答案

at( ) 函数

函数

at( ) 函数返回一个字符表达式或备注字段在另一个字符表达或备注字段中首次出现的位置,从最左边开始计数。

语法

AT(cSearchExpression, cExpressionSearched [, nOccurrence])

参数

cSearchExpression

指定字符表达式,at( ) 函数将在 cExpressionSearched 中搜索此字符表达式。

cExpressionSearched

指定在其中进行搜索的字符表达式。参数 cExpression 和 cExpressionSearched 都可以是任意大小的备注字段。

nOccurrence

指定搜寻 cSearchExpression 在 cExpressionSearched 中的第 nOccurrence 次(第一、第二、第三次等等)出现。默认情况下,at( ) 函数搜索到 cSearchExpression 首次出现 ( nOccurrence=1)。使用 Occurrence 参数可以搜索 cSearchExpression 在 cExpressionSearched 中其他的出现,如果参数 nOccurrence 的值大于 cExpressionSearched 中包含 cExpressionSearched 的数目,at( ) 函数返回 0。

说明

at( ) 函数在第二个字符表达式中搜索首次出现的第一个字符表达式,函数返回第一个字符表达式的首字符在第二个字符表达式中所在的位置。如果没有搜索到,at( ) 函数的返回值为 0。at( ) 函数区分搜索字符的大小写。如果不区别搜索字符的大小写,可使用 atc( ) 函数。

函数示例

store 'now is the time for all good men' to gcstringstore 'is the' to gcfindstringclearat(gcfindstring,gcstring) && 显示 5store 'is' to gcfindstringat(gcfindstring,gcstring) && 显示 o,区分大小写

2024-10-31 16:20:31
赞 5318踩 0

全部回答(2)

at( ) 函数返回一个字符表达式或备注字段在另一个字符表达或备注字段中首次出现的位置,从最左边开始计数。

2024-10-31 16:20:31
赞 6590踩 0