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

 

☞   isequal 두개의 값이 같은지 다른지 비교하는 함수

 

두 개의 string 변수가 동일한지 다른지를 비교하여 그 결과를 알려줍니다.

추가로는 대소문자 구별여부와 space를 trim으로 처리해서 비교할 것인지가 있습니다.

 

생성방법은 각 버전별로 함수오브젝트(isequal)을 만드신 후, 아래 스크립트를 복사하여 바꿔주시기 바랍니다.

 

global type isequal from function_object
end type

forward prototypes
global function boolean isequal (string asLeft, string asRight, readonly boolean abIgnorecase)
global function boolean isequal (string asLeft, string asRight, readonly boolean abIgnorecase, readonly boolean abTrimSpaces)
global function boolean isequal (string asleft, string asright)
end prototypes

global function boolean isequal (string asLeft, string asRight, readonly boolean abIgnorecase);return IsEqual(asLeft, asRight, abIgnorecase, true)
end function

global function boolean isequal (string asLeft, string asRight, readonly boolean abIgnorecase, readonly boolean abTrimSpaces);if abIgnoreCase then
 asLeft = Lower(asLeft)
 asRight = Lower(asRight)
end if
if abTrimSpaces then
 asLeft = Trim(asLeft)
 asRight = Trim(asRight)
end if

return asLeft = asRight
end function

global function boolean isequal (string asleft, string asright);return IsEqual(asLeft, asRight, true)
end function

 

Posted by 농부지기
,