Ver Mensaje Individual
  #2  
Antiguo 02-12-2012
Avatar de Casimiro Noteví
Casimiro Noteví Casimiro Noteví is offline
Merodeador
 
Registrado: sep 2004
Ubicación: En algún lugar.
Posts: 32.671
Reputación: 10
Casimiro Noteví Tiene un aura espectacularCasimiro Noteví Tiene un aura espectacular
Aunque no lo has puesto en el código, se supone que car será un integer.
Aquí te pego un ejemplo, para que veas como trabaja random


Código Delphi [-]
var
  float : single;
  int   : Integer;
  i     : Integer;

 begin
  // Get floating point random numbers in the range 0 <= Number < 1.0
  for i := 1 to 5 do
  begin
    float := Random;
    ShowMessage('float = '+FloatToStr(float));
  end;

  ShowMessage('');

  // Get an integer random number in the range 1..100
  for i := 1 to 5 do
  begin
    int := 1 + Random(100);    // The 100 value gives a range 0..99
    ShowMessage('int = '+IntToStr(int));
  end;
 end;
Responder Con Cita