Ver Mensaje Individual
  #15  
Antiguo 26-05-2004
santana santana is offline
No confirmado
 
Registrado: nov 2003
Posts: 1.030
Reputación: 0
santana cantidad desconocida en este momento
Cita:
Empezado por Julià T.
//creo que realmente la funcion en delphi seria como la siguiente
Cita:
Empezado por Julià T.
Código Delphi [-]
 function comparaCadenas(c1, c2: PChar): integer;
  begin
    if (c1  = nil) or (c2 = nil) then
      result := Integer(c2) - Integer(c1)
    else  begin
      while (c1^ <> #0) and (c2^ <> #0) and (c1^ = c2^) do  begin
        Inc(c1);
        Inc(c2);
      end;
      if (c1^ <>  #0) or (c2^ <> #0) then
        result := Integer(c1^) -  Integer(c2^)
      else
        result := 0;
    end;
  end;
Cita:
Empezado por santana
Código Delphi [-]
  function comparaCadenas(c1, c2: PChar): integer;
begin
  if (c1  = nil) or (c2 = nil) then
  result := Integer(c2) - Integer(c1)
  else  begin
  while (c1^ <> #0) and (c2^ <> #0) and (c1^ = c2^) do  begin
    Inc(c1);
    Inc(c2);
  end;
  if (c1^ <>  #0) or (c2^ <> #0) then
    result := Integer(c1^) -  Integer(c2^)
  else
    result := 0;
  end;
end;  
Sí, creo que sí.
Saludos.
Responder Con Cita