Hola a todos, tengo el siguiente código:
Código Delphi
[-]
TEnumTypeData = (tyNone,tyCurrency, tyBoolean, tyDate, tyDateTime, tyFloat, tyInteger, tyString, tyExpandString, tyTime, tyBinaryData);
TClaveValor = record
private
FClave:string;
FValueDefault:Variant;
FValue:Variant;
FTipo:TEnumTypeData;
procedure SetClave(const Value:string);
procedure SetValueDefault(const Value:variant);
procedure SetValue(const Value:variant);
procedure SetTipo(const Value:TEnumTypeData);
public
property Clave: string read FClave write SetClave;
property ValueDefault: Variant read FValueDefault write SetValueDefault;
property Value:Variant read FValue write SetValue;
property Tipo: TEnumTypeData read FTipo write SetTipo;
end;
procedure TClaveValor.SetClave(const Value:string);
begin
FClave:=Value;
end;
procedure TClaveValor.SetValueDefault(const Value:variant);
begin
FValueDefault:=Value;
end;
procedure TClaveValor.SetValue(const Value:variant);
begin
FValue:=Value;
end;
procedure TClaveValor.SetTipo(const Value:TEnumTypeData);
begin
FTipo:=Value;
end;
type
TArrayClaveValor = array of TClaveValor;
type
TConfigBDRegistro = class
private
FTipoServer:TClaveValor;
FNameServer:TClaveValor;
FRuta:TClaveValor;
FProComunicacion:TClaveValor;
FVendorLib:TClaveValor;
FListCampos:TArrayClaveValor;
procedure setListCamposBD(value:TArrayClaveValor);
function getListCamposBD:TArrayClaveValor;
public
constructor Create;
property TipoServer:TClaveValor read FTipoServer write FTipoServer;
property NameServer:TClaveValor read FNameServer write FNameServer;
property Ruta:TClaveValor read FRuta write FRuta;
property ProComunicacion:TClaveValor read FProComunicacion write FProComunicacion;
property VendorLib:TClaveValor read FVendorLib write FVendorLib;
property ListCampos:TArrayClaveValor read getListCamposBD write setListCamposBD;
end;
constructor TConfigBDRegistro.Create;
begin
Setlength(FListCampos,5);
end;
procedure TConfigBDRegistro.setListCamposBD(Value:TArrayClaveValor);
begin
FTipoServer:=Value[0];
FNameServer:=Value[1];
FRuta:=Value[2];
FProComunicacion:=Value[3];
FVendorLib:=Value[4];
end;
function TConfigBDRegistro.getListCamposBD:TArrayClaveValor;
begin
FListCampos[0]:=FTipoServer;
FListCampos[1]:=FNameServer;
FListCampos[2]:=FRuta;
FListCampos[3]:=FProComunicacion;
FListCampos[4]:=FVendorLib;
result:=FListCampos;
end;
La clase almacena ciertos parámetros de conexión para una BD, el tema es que necesito recorrer los campos de la clase en un bucle, por esto implemento el campo FListCampos, que es un array de TClaveValor, el problema se suscita al asignar valores a los campos a través del array. Nunca ingresa al prodedure setListCamposBD, que es el encargado de asignar lo valores, la llamada que se realiza es la siguiente:
Código Delphi
[-]
....
vInicio:=Low(ListCampos);
vFin:=High(ListCampos);
for vIndice:=vInicio to vFin do begin
ListCampos[vIndice].Value:='un Dato';
end;
....
Gracias de antemano por su ayuda.
Saludos...