1) Function: rowscode () ----- Show n letters per line, automatic wrap
Function RowsCode (STR, N) IF LEN (STR) <= n / 2 ThenRowscode = strelsedim TSTRDIM L, T, CDIM IL = LEN (STR) TSTR = "" T = 0for i = 1 to lc = ASC (MID (STR , I, 1)) IF C <0 THEN C = C 65536IF C> 255 THENT = T 2ELSET = T 1END IFTSTSTSTR = TSTR & (MID (STR, I, 1)) IF T> N THEN TSTR = TSTR & "
"T = 0nd ifnextrowscode = TSTREND IFEND FUNCTION
2) Function: lefttrue () ----- If the length of the string STR is greater than n, the N characters on the left are displayed.
Function Lefttrue (STR) <= N / 2 THEFTTRUE = strelsedim TSTRDIM L, T, CDIM IL = LEN (STR) TSTR = "" T = 0for i = 1 to lc = ASC (MID (STR , i, 1)) IF C <0 THEN C = C 65536IF C> 255 THENT = T 2ELSET = T 1END IFIF T> N THEN EXIT FORTSTR = TSTR & (MID (STR, I, 1)) NextLTLTRUE = TSTR & "..." end ifend function