Hola
cecilio
A ver si probando esto aclaramos algo...
Código Delphi
[-]
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls;
const ne = 20;
type
Tsql= Class(TObject)
private
cm: array[0..ne] of string;
vl: array[0..ne] of string;
tabla: string;
public
constructor create ;
destructor Destroy ; override;
procedure Limpia;
end;
Type
TForm1 = class(TForm)
Button1: TButton;
Memo1: TMemo;
procedure Button1Click(Sender: TObject);
private
public
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
constructor Tsql.create;
begin
inherited Create;
End;
destructor Tsql.Destroy;
Begin
inherited Destroy;
End;
procedure TSql.Limpia;
Var I : Integer;
Begin
For I := Low(cm) to High(cm) do
cm[i] := 'ClubDelphi ' + IntToStr(I);
End;
procedure TForm1.Button1Click(Sender: TObject);
Var
Objeto : TSql;
I : Integer;
begin
Memo1.Lines.Clear;
Objeto := TSql.create;
With Objeto DO
Begin
Limpia;
For I := Low(cm) to High(cm) do
Memo1.Lines.Add(cm[i]);
End;
Objeto.Free;
end;
end.
Código:
object Form1: TForm1
Left = 436
Top = 248
Width = 273
Height = 308
Caption = 'Form1'
Color = clBtnFace
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -11
Font.Name = 'MS Sans Serif'
Font.Style = []
OldCreateOrder = False
PixelsPerInch = 96
TextHeight = 13
object Button1: TButton
Left = 168
Top = 216
Width = 75
Height = 25
Caption = 'Button1'
TabOrder = 0
OnClick = Button1Click
end
object Memo1: TMemo
Left = 32
Top = 32
Width = 209
Height = 153
Lines.Strings = (
'Memo1')
TabOrder = 1
end
end
Saludos y suerte