[ 파워빌더.공통함수 - isNull ]

 

☞   

  [출처 : http://kodigopower.com/ ]

각 타입별로 두 개의 아규먼트를 가지는데, 첫번째는 null 여부를 체크하는 대상이고, 두번째는 만일 첫번째가 null일 경우 대체할 값입니다.

각 파빌 버전별로 함수 오브젝트(isnull)를 만드신 후, edit source나 export 하셔서 아래 스크립트를 복사하여 붙여넣기 하셔서 쓰세요.

 

global type isnull from function_object
end type

forward prototypes
global function string isnull (readonly string asString, readonly string asReplace)
global function long isnull (readonly long alNumber, readonly long alReplace)
global function integer isnull (readonly integer aiNumber, readonly integer aiReplace)
global function date isnull (readonly date adtDate, readonly date adtReplace)
global function time isnull (readonly time atTime , readonly time atReplace)
global function datetime isnull (readonly datetime adtDatetime , readonly datetime adtReplace)
global function decimal isnull (readonly decimal adNumber, readonly decimal adReplace)
global function double isnull (readonly double adNumber, readonly double adReplace)
end prototypes

global function string isnull (readonly string asString, readonly string asReplace);if isnull(asString) then
 return asReplace
else
 return asString
end if
end function

global function long isnull (readonly long alNumber, readonly long alReplace);if isnull(alNumber) then
 return alReplace
else
 return alNumber
end if
end function

global function integer isnull (readonly integer aiNumber, readonly integer aiReplace);if isnull(aiNumber) then
 return aiReplace
else
 return aiNumber
end if
end function

global function date isnull (readonly date adtDate, readonly date adtReplace);if isnull(adtDate) then
 return adtReplace
else
 return adtDate
end if
end function

global function time isnull (readonly time atTime, readonly time atReplace);if isnull(atTime) then
 return atReplace
else
 return atTime
end if
end function

global function datetime isnull (readonly datetime adtDatetime, readonly datetime adtReplace);if isnull(adtDatetime) then
 return adtReplace
else
 return adtDatetime
end if
end function

global function decimal isnull (readonly decimal adNumber, readonly decimal adReplace);if isnull(adNumber) then
 return adReplace
else
 return adNumber
end if
end function

global function double isnull (readonly double adNumber, readonly double adReplace);if isnull(adNumber) then
 return adReplace
else
 return adNumber
end if
end function

Posted by 농부지기
,