Re: Spaces

From: AlanGLLoyd (alanglloyd_at_aol.com)
Date: 11/19/04


Date: 19 Nov 2004 21:30:23 GMT

In article <d9GdnZ5zMt3VkgPcRVnyvg@pipex.net>, "Richard Hutchinson"
<richard.hutchinson@dsl.pipex.com> writes:

>menufile[chk]:=temp+Spaces(12-(length(temp)));

> for pos:=1 to 15 do
> begin
> pack:=pack+menufile[pos];
> end;
>

Or ...

Pack := '';
for i := 1 to 15 do
  Pack := Format('%s%.12s', [Pack, MenuFile[i] + StringOfChar(' ', 12)]);

Or somewhat quicker (if you're worried about speed) ...

Pack := StringOfChar(' ', 12 * 15);
for i := 0 to 14 do
  for j := 1 to Length(MenuFile[i]) do
    Pack[(i * 15) + j] := MenuFile[i + 1][j]; // transfer each MenuFile[i]
character into Pack at intervals of 12 characters.

You'll find things a bit easier and clearer if your arrays had a zero starting
index. But strings, of course start at [1]

Alan Lloyd
alanglloyd@aol.com



Relevant Pages

  • Re: Concatenate, conjoin, meld, extract images
    ... 1, and only 1, gif to read each character from ... image, letter 'b' is the second image, so calculate second image location ... be quicker, but upon reconsidering, loading one big image up and then ... access occurs versus 4 disk accesses for 4 character words). ...
    (comp.lang.php)
  • Re: the dreaded voice chat patch has arrived!
    ... Quicker, more efficient, and just flat out ... character by hearing them talk than by reading text. ... I'm concerned that the sound of my female voice will spoil the male-character role-play illusion for people. ...
    (alt.games.warcraft)
  • Re: Some breakfast timing issues
    ... just let your server know. ... to turn the table quicker. ... They don't want to rush you, ... you can duck out immediately after seeing the last character. ...
    (rec.arts.disney.parks)
  • Re: the dreaded voice chat patch has arrived!
    ... Quicker, more efficient, and just flat out ... character by hearing them talk than by reading text. ... they did make the party bars flash to indicate whose talking. ...
    (alt.games.warcraft)