Ver Mensaje Individual
  #2  
Antiguo 15-10-2005
Avatar de Lepe
[Lepe] Lepe is offline
Miembro Premium
 
Registrado: may 2003
Posts: 7.424
Reputación: 29
Lepe Va por buen camino
Cita:
Empezado por Ayuda QuickReports
type TQREvResultType = (resInt, resDouble, resString, resBool, resError)
type TQREvResult = record
case Kind : TQREvResultType of
resInt : (intResult : Longint);
resDouble : (dblResult : Double);
resString : (strResult : String[255]);
resBool : (booResult : Boolean);
end
property Value : TQREvResult

Description

Use the Value property to access the value of the Expression. It returns a variant record with the result of the calculation.
Por tanto: si sabes que el campo es un float:
Código Delphi [-]
 MiValorDouble := qrExpr.Value.resdouble;

Edito: Algo más general para utilizarlo en tiempo de ejecución sería:
Código Delphi [-]
var x:tqrevresult;
 valor:Variant;
begin
 case x.Kind of
  resInt    : valor := x.intResult;
  resDouble : valor := x.dblResult;
  resString : valor := x.strResult;
  resBool   : valor := x.booResult;
  else
      valor := Unassigned;
  end;
end;

saludos
__________________
Si usted entendió mi comentario, contácteme y gustosamente,
se lo volveré a explicar hasta que no lo entienda, Gracias.

Última edición por Lepe fecha: 15-10-2005 a las 15:18:30.
Responder Con Cita