Re: Interesting shortcut syntax for filling arrays with common value: vByteSorted[0..255] := false;



Fair enough my syntax is still shorter:

S[0..79] := ' ';
// vs
FillChar(S, SizeOf(S), Ord(' '));

Bye,
Skybuck.

"Fons" <fonzzzNO@xxxxxxxxxxxxxxxxxxx> wrote in message
news:4839852d$0$14357$e4fe514c@xxxxxxxxxxxxxxxxx

You must be God Allmighty. Not declaring vByteSorted and not using "begin"
and "end".

Fons.

"Fons" <fonzzzNO@xxxxxxxxxxxxxxxxxxx> wrote in message
news:483882ec$0$14346$e4fe514c@xxxxxxxxxxxxxxxxx
Sometimes FillChar will do:

var S : array[0..79] of char;
begin
{ Set to all spaces }
FillChar(S, SizeOf(S), Ord(' '));
end;

Your 4 code lines, versus my 1 code line.

My one line is 75% more efficient than yours =D

Bye, Bye,
Skybuck ;)

One could simply write:

vByteSorted[0..255] := false;

Would be nice ! :)

Bye,
Skybuck.




.



Relevant Pages

  • Re: VBA Code Translation
    ... > how can i say the following in VBA Code: ... this Syntax is a little bit shorter: ... http://excel.codebooks.de (Das Excel-VBA Codebook) ...
    (microsoft.public.excel.programming)
  • Re: How complex is complex?
    ... Tim Roberts wrote: ... In Python 3 those lines become shorter: ... That's a syntax I have not seen in the 2-to-3 difference docs, ...
    (comp.lang.python)
  • Re: How complex is complex?
    ... In Python 3 those lines become shorter: ... That's a syntax I have not seen in the 2-to-3 difference docs, ... Providenza & Boekelheide, Inc. ...
    (comp.lang.python)