How to create a Property with a RECORD type - DELPHI

Asked

Viewed 44 times

0

Good morning...

I’m trying to create propertys for a form.

Creating Property with strings types I know how to do, however I’m trying to create a Property of a RECORD type that already exists..

I don’t know how to create this Property..

Do any of you have any idea how to create Record type Press?

I have the following record in the system...

Type TColuna_Grid = Record
     campo_nome : String;
     campo_titulo : String;
     campo_width : integer;
End;

Using Record as array

  TColuna_Grid_Array = Array of TColuna_Grid;

Trying to Create the Property within the form

private 
  fArray_Coluna_Grid : TColuna_Grid_Array;

  function GetColuna_Grid_Array(AIndex: Integer): TColuna_Grid_Array;
  procedure SetColuna_Grid_Array(AIndex: Integer;  const Value: TColuna_Grid_Array);

public
    { Public declarations } 

    Property Array_Coluna_Grid[AIndex : Integer] : TColuna_Grid_Array read GetColuna_Grid_Array Write SetColuna_Grid_Array;

Two remarks...

1º As I said before... the code above is an ATTEMPT .. I have no idea if it is right..

2º To use the variable you would have to set it to a size with the following code..:

SetLength(fArray_Coluna_Grid , ???INTEIRO_COM_O_TAMANHO????)

How and where to set the size of this array??

I hope I’ve been able to describe my need clearly.

In case someone has not understood something, please contact me and we will discuss these points.

Hugs :)

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.