Ver Mensaje Individual
  #1  
Antiguo 26-04-2011
naverus naverus is offline
Registrado
 
Registrado: feb 2008
Posts: 3
Reputación: 0
naverus Va por buen camino
ArrayOfAnyType

Hola:

Hice la conexión a un webservice (Visual C) , pero uno de los métodos requiere de arreglos de tipo ArrayOfAnytype, el problema es que esta clase no tiene un método add, alguien sabe como se puede manejar esta clase?
Código Delphi [-]
  
  ArrayOfAnyType = class(TRemotable)
  private
    FanyType: anyType;
  public
    FList: TList;
    constructor Create; override;
    function   GetVariantArray(Index: Integer): Variant;
    function   GetVariantArrayLength: Integer;
    property   VariantArray[Index: Integer]: Variant read GetVariantArray; default;
    property   Len: Integer read GetVariantArrayLength;
    procedure Add(Valor : TRemotable);
  published
    property anyType: anyType read FanyType write FanyType;
  end;

-------------------------------------------------------------------------
Código Delphi [-]
procedure ArrayOfAnyType.Add(Valor: TRemotable);
begin
  FList.Add(Valor);
end;

constructor ArrayOfAnyType.Create;
begin
  inherited Create;
  FSerializationOptions := [xoInlineArrays];
  FList := TList.Create();
end;

function ArrayOfAnyType.GetVariantArray(Index: Integer): Variant;
begin
  Result := FanyType[Index];
end;

function ArrayOfAnyType.GetVariantArrayLength: Integer;
begin
  if Assigned(FanyType) then
    Result := Length(FanyType)
  else
  Result := 0;
end;

Última edición por ecfisa fecha: 26-04-2011 a las 23:07:18. Razón: Etiquetas [DELPHI] y [/DELPHI]
Responder Con Cita