<table cellspacing="0" cellpadding="0" border="0" ><tr><td valign="top" style="font: inherit;">Hi all:<br>copied that, but interface TextClass GetChars is kind of different from GetChar in Text. I can't see the interrelation<br>Thanks in advance<br><br>--- El <b>mar, 26/6/12, Dragiša Durić <i><dragisha@m3w.org></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ć <dragisha@m3w.org><br>Asunto: Re: [M3devel] AND (…, 16_ff)… Not serious - or so I hope!<br>Para: "Daniel Alejandro Benavides D." <dabenavidesd@yahoo.es><br>CC: "m3devel" <m3devel@elegosoft.com><br>Fecha: martes, 26 de junio, 2012 07:27<br><br><div id="yiv561263949"><div>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="yiv561263949Apple-interchange-newline"><blockquote type="cite"><table border="0" cellpadding="0" cellspacing="0"><tbody><tr><td style="font-family: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; font-size: inherit; line-height: inherit; font-size-adjust: inherit; font-stretch: inherit;" valign="top">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 rel="nofollow" ymailto="mailto:dragisha@m3w.org" target="_blank" href="/mc/compose?to=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 rel="nofollow" ymailto="mailto:dragisha@m3w.org" target="_blank" href="/mc/compose?to=dragisha@m3w.org">dragisha@m3w.org</a>><br>Asunto: [M3devel] AND (…, 16_ff)… Not serious - or so I hope!<br>Para: "m3devel" <<a rel="nofollow" ymailto="mailto:m3devel@elegosoft.com" target="_blank" href="/mc/compose?to=m3devel@elegosoft.com">m3devel@elegosoft.com</a>><br>Fecha: martes, 26 de junio, 2012 05:18<br><br><div class="yiv561263949plainMail">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></div></div></blockquote></td></tr></table>