Ver Mensaje Individual
  #9  
Antiguo 09-03-2012
Avatar de dec
dec dec is offline
Moderador
 
Registrado: dic 2004
Ubicación: Alcobendas, Madrid, España
Posts: 13.142
Reputación: 36
dec Tiene un aura espectaculardec Tiene un aura espectacular
Hola,

Ese truco no me le sabía yo, Marcos, se agradece.

Aunque me parece a mí que Román no va por ahí...

Entonces el código ya podría quedar, como poco, de esta manera:

Código Delphi [-]
for i := 0 to 25 do // From A to Z
begin
  if Drive shr i and 1 = 1 then
  begin
    if s = '' then
      s := Chr( Ord( i + TRICK_ASCII_NUMBER ) )
    else
      s := s +'#'+ Chr( Ord( i + TRICK_ASCII_NUMBER ) );
  end;
end;

Siendo "TRICK_ASCII_NUMBER" igual a 65. Prescindiendo ya del arreglo "DRIVES".
Responder Con Cita