Guest User

Untitled

a guest
Dec 17th, 2017
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.19 KB | None | 0 0
  1. unit Exemplo;
  2.  
  3. interface
  4. uses Classes,
  5. SysUtils, typinfo;
  6.  
  7. const
  8.  
  9. type
  10.  
  11. {TRecordRateio}
  12. TRecordRateio = Record
  13. IdContaCorrente : Integer;
  14. CodBanco : String;
  15. Agencia : String;
  16. DVAgencia : String;
  17. ContaCorrente : String;
  18. DVContaCorrente : String;
  19. DVAgenciaConta : String;
  20. NomeBeneficiario : String;
  21. CodRateio : String;
  22. EPercentual : String;
  23. ValorRateio : Currency;
  24. FloatingRateio : String;
  25. DataCredito : TDateTime;
  26. end;
  27.  
  28. TArrayOfRateio = Array of TRecordRateio;
  29.  
  30.  
  31. TTeste = class(TComponent)
  32. private
  33. fRateio : TArrayOfRateio;
  34. function GetRateio(AIndex: Integer): TArrayOfRateio;
  35. procedure SetRateio(AIndex: Integer; const Value: TArrayOfRateio);
  36.  
  37. public
  38. constructor Create( AOwner : TComponent ) ; override ;
  39. destructor Destroy; override;
  40. property Rateio[AIndex : Integer] : TArrayOfRateio read GetRateio Write SetRateio; default;
  41. published
  42. property Nome : String read fNome write fNome;
  43. end;
  44.  
  45.  
  46. implementation
  47.  
  48. Uses Forms, Math, dateutils, strutils;
  49.  
  50.  
  51. constructor TTeste.Create( AOwner : TComponent );
  52. begin
  53. inherited Create(AOwner);
  54. fNome := '';
  55. end;
  56.  
  57. destructor TTeste.Destroy;
  58. begin
  59. inherited;
  60. end;
  61.  
  62.  
  63. function TTeste.GetRateio(AIndex: Integer): TArrayOfRateio;
  64. begin
  65. Result[AIndex].IdContaCorrente := Self.fRateio[AIndex].IdContaCorrente;
  66. Result[AIndex].CodBanco := Self.fRateio[AIndex].CodBanco;
  67. Result[AIndex].Agencia := Self.fRateio[AIndex].Agencia;
  68. Result[AIndex].DVAgencia := Self.fRateio[AIndex].DVAgencia;
  69. Result[AIndex].ContaCorrente := Self.fRateio[AIndex].ContaCorrente;
  70. Result[AIndex].DVContaCorrente := Self.fRateio[AIndex].DVContaCorrente;
  71. Result[AIndex].DVAgenciaConta := Self.fRateio[AIndex].DVAgenciaConta;
  72. Result[AIndex].NomeBeneficiario := Self.fRateio[AIndex].NomeBeneficiario;
  73. Result[AIndex].CodRateio := Self.fRateio[AIndex].CodRateio;
  74. Result[AIndex].FloatingRateio := Self.fRateio[AIndex].FloatingRateio;
  75. Result[AIndex].EPercentual := Self.fRateio[AIndex].EPercentual;
  76. Result[AIndex].ValorRateio := Self.fRateio[AIndex].ValorRateio;
  77. Result[AIndex].DataCredito := Self.fRateio[AIndex].DataCredito;
  78. end;
  79.  
  80. procedure TTeste.SetRateio(AIndex: Integer;
  81. const Value: TArrayOfRateio);
  82. begin
  83. frateio[AIndex].Idcontacorrente := Value[AIndex].IdContaCorrente;
  84. fRateio[AIndex].CodBanco := Value[AIndex].CodBanco;
  85. fRateio[AIndex].Agencia := Value[AIndex].Agencia;
  86. fRateio[AIndex].DVAgencia := Value[AIndex].DVAgencia;
  87. fRateio[AIndex].ContaCorrente := Value[AIndex].ContaCorrente;
  88. fRateio[AIndex].DVContaCorrente := Value[AIndex].DVContaCorrente;
  89. fRateio[AIndex].DVAgenciaConta := Value[AIndex].DVAgenciaConta;
  90. fRateio[AIndex].NomeBeneficiario := Value[AIndex].NomeBeneficiario;
  91. fRateio[AIndex].CodRateio := Value[AIndex].CodRateio;
  92. fRateio[AIndex].FloatingRateio := Value[AIndex].FloatingRateio;
  93. fRateio[AIndex].EPercentual := Value[AIndex].EPercentual;
  94. fRateio[AIndex].ValorRateio := Value[AIndex].ValorRateio;
  95. fRateio[AIndex].DataCredito := Value[AIndex].DataCredito ;
  96. end;
Add Comment
Please, Sign In to add comment