Two functions in the display format: Automatic wrap, automatic omittion

zhaozj2021-02-16  142

1) Function: rowscode () ----- N letters per line, automatic wrap Function RowsCode (STR, N) if len (STR) <= N / 2 THEN ROWSCODE = STR ELSE DIM TSTR DIM L, T, C DIM IL = LEN (STR) TSTR = "" T = 0 for i = 1 to LC = ASC (MID (STR, I, 1)) IF C <0 THEN C = C 65536 IF C> 255 THEN T = T 2 else t = t 1 end if Tstr = TSTR & (MID (STR (STR, I, 1)) IF T> N TSTR = TSTR & "
" T = 0 end if next rowscode = TSTR END IF END FUNCTION

2) Function: lefttrue () ----- If the length of the string STR is greater than n, the N-character Function Lefttrue (STR, N) IF LEN (STR) is displayed by the left side (STR) <= N / 2 Then Lefttrue = Str else DIM TSTR DIM L, T, C DIM IL = LEN (STR) TSTR = "" T = 0 for i = 1 to LC = ASC (MID (STR, I, 1)) IF C <0 THEN C = C 65536 IF C> 255 THEN T = T 2 else t = t 1 End if IF T> n THEN EXIT for TSTR = TSTR & (MID (STR, I, 1)) Next Lefttrue = TSTR & "..." end if end function

转载请注明原文地址:https://www.9cbs.com/read-8312.html

New Post(0)