|
REM **********************************************************
REM 指定数、指定文字列左側を埋める
REM **********************************************************
Function Lpad( strValue, str, nLen )
Lpad = Right( String(nLen,str) & strValue, nLen )
End Function
Function LpadB( strValue, str, nLen )
Dim strWork,nLen2
strWork = Right( String(nLen,str) & strValue, nLen )
nLen2 = nLen
Do While ByteLen( strWork ) > nLen
nLen2 = nLen2 - 1
if nLen2 <= 0 then
Exit Do
end if
strWork = Right( String(nLen,str) & strValue, nLen2 )
Loop
LpadB = strWork
End Function
REM **********************************************************
REM 指定数、指定文字列右側を埋める
REM **********************************************************
Function Rpad( strValue, str, nLen )
Rpad = Left( strValue & String(nLen,str), nLen )
End Function
Function RpadB( strValue, str, nLen )
Dim strWork,nLen2
strWork = Left( strValue & String(nLen,str), nLen )
nLen2 = nLen
Do While ByteLen( strWork ) > nLen
nLen2 = nLen2 - 1
if nLen2 <= 0 then
Exit Do
end if
strWork = Left( strValue & String(nLen,str), nLen2 )
Loop
RpadB = strWork
End function
| |