# Prog. Version..: '5.10.12-10.02.03(00009)' #
#
# Program name...: ccl_isum.4gl
# Descriptions...: 檢查傳進來的字串是不是都是數字
# Date & Author..: 03/09/08 by Hiko
# Usage..........: CALL cl_numstr (p1,p2)
#傳回...轉換成功 true
# 轉換失敗 false
DATABASE ds
GLOBALS "../../config/top.global" #FUN-7C0053
function ccl_isnum(p1)
define p1 string
define l_i, l_len integer
define l_ret char(1)
if cl_null(p1) then
let l_ret='N'
else
let l_len=p1.getLength( )
let l_ret='Y'
for l_i = 1 to l_len
if not (p1.substring(l_i,1) matches '0123456789') then
let l_ret='N'
exit for
end if
end for
end if
if l_ret='Y' then
return true
else
return false
end if
end function
沒有留言:
張貼留言