參考手冊

DTW_WORDPOS


AIX HP-UX Linux OS/2 OS/390 OS/400 PTX SUN Win NT
X X X X X X X X X

目的

傳回在另一個字串中,某一個字串第一次出現的字組號碼。

格式

@DTW_WORDPOS(stringIn1, stringIn2, n, stringOut)

@DTW_WORDPOS(stringIn1, stringIn2, stringOut)

@DTW_rWORDPOS(stringIn1, stringIn2, n)

@DTW_rWORDPOS(stringIn1, stringIn2)

參數

表 116. DTW_WORDPOS 參數
資料類型 參數 使用 說明
字串 stringIn1 IN 一個變數或文字字串。
字串 stringIn2 IN 一個所要搜尋的變數或文字字串。
整數 n IN stringIn2 中要開始進行搜尋的字組位置。如果這個值大於在 stringIn2 中的字組數目, 則將會傳回 0。預設值是從 stringIn2 的開頭進行搜尋。
字串 stringOut OUT stringIn1stringIn2 中之的字組位置。

回覆碼

表 117. DTW_WORDPOS 回覆碼
回覆碼 說明
-1001 伺服器無法處理 Net.Data 的配置記憶體要求。
1001 輸入參數包含 NULL 值。
1003 函數呼叫上傳遞的參數數目不正確。
1005 函數呼叫上傳遞的參數必須是字串變數,但卻是不同的變數類型。
1006 文字字串傳遞給函數呼叫中的參數, 但此參數必須是輸出參數。
1007 參數包含的值無效。

用法注意事項

多重空白將以一個單一空白來看待,以供比較。

範例

範例 1

@DTW_WORDPOS("the", "Now is the time", result)

範例 2

@DTW_WORDPOS("The", "Now is the time", result)

範例 3

@DTW_WORDPOS("The", "Now is the time", "5", result)

範例 4

@DTW_WORDPOS("is  the", "Now is     the time", result)

範例 5

@DTW_rWORDPOS("be", "To be or not to be", "3")


[ 頁面頂端 | 前一頁 | 下一頁 | 目錄 | 索引 ]