at( ) 函式

at( ) 函式

at( ) 函式返回一個字元表達式或備註欄位在另一個字元表達或備註欄位中首次出現的位置,從最左邊開始計數。

基本介紹

  • 中文名:at( ) 函式
  • 外文名:At () function
語法,參數,cSearchExpression,cExpressionSearched,nOccurrence,說明,函式示例,

語法

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 gcfindstringclear? at(gcfindstring,gcstring) && 顯示 5store 'is' to gcfindstring? at(gcfindstring,gcstring) && 顯示 o,區分大小寫

相關詞條

熱門詞條

聯絡我們