I won't answer everything but just on this one question:<br><br><div class="gmail_quote">On 23 November 2010 11:04, John Bird <span dir="ltr"><<a href="mailto:johnkbird@paradise.net.nz">johnkbird@paradise.net.nz</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">Extra question:<br>
<br>
It looks like code like<br>
<br>
for i:=1 to length(string1) do<br>
begin<br>
DoSomethingWithOneChar(string1[i]);<br>
end;<br>
<br>
cannot be used reliably. The problems are that length(string1) looks like<br>
it cannot be safely used - as unicode characters may include 2 codepoints<br>
and length(string1) highlights that there is a difference between the number<br>
of unicode characters in a string and the number of codepoints. Still<br>
figuring out what is the best practice here, as I have quite a lot of string<br>
routines. Should be be OK as long as the unicode text actually is ASCII.<br>
<div class="im"><br></div></blockquote><div><br></div><div>you can use something like this:</div><div><br></div><div>var</div><div> C: Char;</div><div>...</div><div> for C in String1 do</div><div> begin</div><div> DoSomethingWithOneChar(C);</div>
<div> end;</div><div><br></div><div>In this case you don't need to know the index of each character, you just get the char using the for..in..do loop.</div><div><br></div><div><br></div><div> </div></div>