<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">If you cared to read, for example Text.i3, you would see this is exactly what cm3 people meant to be.<div><br><div><div>On Jun 26, 2012, at 2:12 PM, Daniel Alejandro Benavides D. wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><table cellspacing="0" cellpadding="0" border="0"><tbody><tr><td valign="top" style="font: inherit;">Hi all:<br>Maybe is a left over of older code (almost just used a decade ago) but if not, then this meant to be just a partial implementation? If we are to get serious about memory usage seems over strict (or just in case you don't need system NIL terminated widechars be checked?).<br>Thanks in advance<br><br>--- El <b>mar, 26/6/12, Dragiša Durić <i><<a href="mailto:dragisha@m3w.org">dragisha@m3w.org</a>></i></b> escribió:<br><blockquote style="border-left: 2px solid rgb(16, 16, 255); margin-left: 5px; padding-left: 5px;"><br>De: Dragiša Durić <<a href="mailto:dragisha@m3w.org">dragisha@m3w.org</a>><br>Asunto: [M3devel] AND (…, 16_ff)… Not serious - or so I hope!<br>Para: "m3devel" <<a href="mailto:m3devel@elegosoft.com">m3devel@elegosoft.com</a>><br>Fecha: martes, 26 de junio, 2012 05:18<br><br><div class="plainMail">This piece of code, from TextClass.m3, disturbs me… a lot.<br><br>If we are to use WIDECHAR, I think we must be a lot more serious
 than this.<br><br>Probably, text pieces are limited to 128 bytes by design, somewhere. But - whose idea was to "narrow" by ignoring everything except 8 LSB's? By mapping set of 2^20 elements to set of 2^8 elements.<br><br>Probably by someone whose mother tongue is fully writeable with ASCII :).<br><br>====<br>PROCEDURE GetChars (t: TEXT;  VAR a: ARRAY OF CHAR;  start: CARDINAL) =<br> VAR<br>   info : Info;<br>   cnt  : INTEGER;<br>   next : CARDINAL := 0;<br>   buf  : ARRAY [0..127] OF WIDECHAR;<br> BEGIN<br>   t.get_info (info);<br>   cnt := MIN (NUMBER (a), info.length - start);<br>   WHILE (cnt > 0) DO<br>     t.get_wide_chars (buf, start);<br>     FOR i := FIRST (buf) TO LAST (buf) DO<br>       IF (cnt = 0) THEN RETURN END;<br>   
    a[next] := VAL (Word.And (ORD (buf[i]), 16_ff), CHAR);<br>       INC (next);  DEC (cnt);<br>     END;<br>     INC (start, NUMBER (buf));<br>   END;<br> END GetChars;<br>====<br><br></div></blockquote></td></tr></tbody></table></blockquote></div><br></div></body></html>