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




Now we've got the correct comparison. Yours is shorter and yours is checked by the compiler. But: mine is all you got.

Fons.


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: [S390] cio: Make ccw_dev_id_is_equal() more robust.
    ... It would be a little bit shorter. ... The compiler probably ... won't care and generate the same code.. ...
    (Linux-Kernel)
  • Re: padding a string
    ... In article, Karl Heinz Buchegger ... > But you can do shorter: ... Even better if your compiler supports it, ... Alwyn ...
    (alt.comp.lang.learn.c-cpp)
  • Re: RosAsm
    ... > as OllyDebug explained your compiler does this the smart way, ... > and use the shorter form if applicable anyway. ... Encode-Decode Box (in the Main Menu Item. ...
    (alt.lang.asm)