參考手冊

DTW_LASTPOS


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

目的

傳回在另一個字串中,某一個字串最後一次出現的位置, 從第 n 個字元開始往回算 (從右到左)

格式

@DTW_LASTPOS(stringIn1, stringIn2, n, position)

@DTW_LASTPOS(stringIn1, stringIn2, position)

@DTW_rLASTPOS(stringIn1, stringIn2, n)

@DTW_rLASTPOS(stringIn1, stringIn2)

參數

表 86. DTW_LASTPOS 參數
資料類型 參數 使用 說明
字串 stringIn1 IN 一個在 stringIn2 中被搜尋的變數或文字字串。
字串 stringIn2 IN 一個變數或文字字串。
整數 n IN 位於 stringIn2 中開始搜尋 stringIn1 的字元位置。預設值是從最後一個字元開始搜尋, 並往前掃描 (從右至左)。
整數 position OUT stringIn2 中出現 最後一個 stringIn1 的位置。 如果找不到的話,將會傳回 0。

回覆碼

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

範例

範例 1

@DTW_LASTPOS(" ", "abc def ghi", result)

範例 2

@DTW_LASTPOS(" ", "abc def ghi", "10", result)

範例 3

@DTW_rLASTPOS(" ", "abc def ghi", "7")


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