1 / 1
" HLeftBMore"으로 검색하여,
1 건의 기사가 검색 되었습니다.
-
2014-04-30문자 채우기문자(숫자)를 출력하면서 특정문자를 결합하는 경우에 사용한다 - 숫자 "1"을 네자리의 Numneric(빈자리가 "0"로 채워진) 4자리로 변환 하는 경우 1 => "0001" - 좌우측으로 여백문자처리의 경우 • FillString(): 특정문자 채우기 • FillZero(): "0" 문자 채우기 • FillSpace(): 스페이스 채우기문자 자르기mid() 함수를 이용하여 문자를 자르는 경우 2byte 문자도 자릿수에 상관 없이 1문자로 처리되기 떄문에 의도한 것보다 길게 나오는 경우가 많은데 2byte 문자를 감안하여 해당 자릿수에서 문자를 잘라 반환 한다 - 게시판의 제목 등 길어질 수 있는 내용을 좁은 구역에 출력시 유효 - 지정길이보다 긴 경우 +More 사용 • HLeftB(): 2byte 문자 자르기 • HLeftBMore(): 2byte 문자 자른 후 길이가 넘는 경우 "…" 문자 추가<%'===============================================' >> Fill Stuff functions'' FillZero( cString, iLength )' FillSpace( cString, iLength )' FillString( cString, iLength, cFillString )''===============================================function FillZero( cString, iLength )FillZero = FillString( cString, iLength, "0" )end functionfunction FillSpace( cString, iLength )FillSpace = FillString( cString, iLength, " " )end functionfunction FillSpaceRight( cString, iLength )FillSpaceRight = FillStringRight( cString, iLength, " " )end functionfunction FillString( cString, iLength, cFillString )if( iLength >Len(cString) ) thenFillString = ( String( iLength -Len( cString ), cFillString ) & cString )elseFillString = cStringend ifend functionfunction FillStringRight( cString, iLength, cFillString )if( iLength >Len(cString) ) thenFillStringRight = ( cString & String( iLength -Len( cString ), cFillString ) )elseFillStringRight = cStringend ifend functionfunction HLeftB( cString, iLen ) dim i, c, a, bdim cReturnb = 0cReturn = ""if not IsNull(cString) thenfor i = 1 to Len(cString)c = mid(cString,i,1)a = asc(c)cReturn = cReturn&cif (a>255 or a<0) thenb = b+2elseb = b+1end ifif (iLen=<b) thenexit forend ifnextend ifHLeftB = cReturnend functionfunction HLeftBMore( cString, iLen ) dim cc = HLeftB( cString, iLen ) if (cString>c) thenc = c &"…"end ifHLeftBMore = cend function%>
1
