[ 파워빌더.공통함수 - isEmptyOrNull ]
☞ isemptyornull ,변수내용이 null이나 값이없는지 파악하는 함수 |
앞서 작성한 isnull 함수가 있다면, 다음의 함수를 추가로 사용하시면.(http://cafe.naver.com/pentaeduclub/4021) 매번, if isnull(변수) or trim(변수) = '' then ... 하시던 스크립트를 if isemptyornull(변수) then 으로 줄일 수 있습니다.
물론 각 타입별로 만들어져 있구요...
작성방법은 동일합니다. 각 버전별로 함수오브젝트(isemptyornull)를 만드시고, 아래 스크립트로 바꿔주세요. global type isemptyornull from function_object forward prototypes global function boolean isemptyornull (readonly string asString);return IsEmptyOrNull(asString, TRUE) global function boolean isemptyornull (readonly string asString, boolean abTrimSpace); global function boolean isemptyornull (readonly long alLong);return IsNull(alLong, 0) = 0 global function boolean isemptyornull (readonly integer aiInt);return IsNull(aiInt, 0) = 0 global function boolean isemptyornull (readonly date adtDate);return IsNull(adtDate, 1900-01-01) = 1900-01-01 global function boolean isemptyornull (readonly decimal adDecimal);return IsNull(adDecimal, Dec("0.00")) = Dec("0.00") global function boolean isemptyornull (readonly double adDouble);return IsNull(adDouble, Double("0.00")) = Double("0.00") |
'파워빌더 > 공통함수' 카테고리의 다른 글
파워빌더.공통함수 - bit연산 (0) | 2017.01.26 |
---|---|
파워빌더.공통함수 - iif (0) | 2017.01.26 |
파워빌더.공통함수 - isNumber (0) | 2017.01.26 |
파워빌더.공통함수 - isEqual (0) | 2017.01.26 |
파워빌더.공통함수 - isNull (0) | 2017.01.26 |