Solved

How to create a dynamic event handlers for components created at runtime?

Posted on 2011-09-17
13
678 Views
Last Modified: 2012-05-12
Hi,

I'm using Delphi 7, Ent., SP3 on a WinXP Pro SP3 box.

I have a small application to display image thumbnails.   There can be 5 to +500 thumbs on multiple tabs.

The layers of the form are as follows:
TForm
  TPanel
    TPageControl
       TImage
        TLabel


Components in italic are created at run-time.
 
I need an event handler for each TImage or each TLabel to launch Windows Image/Fax viewer on DblClick event.  When the event handler fires, I need to have either the name of the associated TImage or the TLabel name.

How can this be done when the TImage and TLabel are created at run-time?

A screen shot of the demonstration application is shown below.  Note, the Caption of the Labels is the TImage control name.  The Name of the label is Lblx where x=1 to x=n

Thanks.

PS.  The name of the TImagex, TLabelx can be stored in an array...



Display1.jpg
0
Comment
Question by:IT79637
  • 7
  • 5
13 Comments
 

Expert Comment

by:Pit Z
ID: 36554783

// with this assign runtime inly double click
for i := 0 to 500 do begin
   Lab: TLabel.Create(nil);
   Lab.Name := 'Lab' + IntToStr(i);
   Lab.OnDoubleClick := Event_FaxView(Lab);
end;


// this is event double CLick
procedure Event_FaxView(Sender: TObject); WM_DoubleClick;
begin
   if Sender.NAme = '' then begin // --> make your  logic by name or Tag property
     // here label

   end
   else begin
     // here image

   end;
end;



0
 
LVL 19

Expert Comment

by:Thommy
ID: 36554813
Declare event handlers in Private-section of your Form:

//Decaration TForm1:  
  private  
      procedure LblxDblClick(Sender: TObject);  
      procedure ImagexDblClick(Sender: TObject);  
...

Implementation

 procedure TForm1.LblxDblClick(Sender: TObject);  
 var
    LblxControlName:string;
    ImagexControlName:string;
 begin
    LblxControlName:=(sender as TLabel).Name;
    ImagexControlName:=(sender as TLabel).caption;

   //code to get filename and start Windows Image/Fax viewer
   ...
 end;

 procedure TForm1.ImagexDblClick(Sender: TObject);  
 var
    ImagexControlName:string;
 begin
   ImagexControlName:=(sender as TImage).Name;

   //code to get filename and start Windows Image/Fax viewer
  ...
 end;



When dynamically creating your Image and Labels set event handlers to OnDblClick events
 Labelx.OnDblClick := Form1.LblxDblClick;
  Imagex.OnDblClick := Form1.ImagexDblClick;



   
0
 
LVL 1

Author Comment

by:IT79637
ID: 36554938
Thanks for your reply.

You can see my original code is commented out.

I'm  getting multiple errors on the code below.  
1.  on "Lab:" - undeclared identifier.
2.  with "Lab." - missing operator or semicolon on Parent,..., Caption. (8 occurrences).
3.  procedure Event_FaxView(Sender: TObject); WM_DoubleClick;  does not like "WM_DoubleClick;"  in the procedure declarations at top.
4.  procedure Event_FaxView(Sender: TObject); WM_DoubleClick;  does not like "WM_DoubleClick;"  in the code section after implementation
{$R *.dfm}


I'm not a programmer by trade.  This is more of a hobby than anything else.  Thanks in advance for your patience!
//with TLabel.Create(Self) do
//begin
         Lab: TLabel.Create(nil);   //Not part of original code
         Lab.Parent := scrlb;
         Lab.Name   := 'Label' + IntToStr(iLabelIdx);
         Lab.Width  := 105;
         Lab.Height := 13;
         Lab.Top    := iActTop + 160 +2;
         Lab.Left   := iActLeft;
         Lab.Caption :=  arImageName[idx];
         Lab.Event.OnDoubleClick := Event_FaxView(Lab);
         Inc(iLabelIdx);
//end;

Open in new window

0
Simplifying Server Workload Migrations

This use case outlines the migration challenges that organizations face and how the Acronis AnyData Engine supports physical-to-physical (P2P), physical-to-virtual (P2V), virtual to physical (V2P), and cross-virtual (V2V) migration scenarios to address these challenges.

 
LVL 1

Author Comment

by:IT79637
ID: 36557204
Hi,

Can't get code to work.

Below is what I have coded.

I changed how I create  TImage to the same way I create the TScrollBox control.

If I place " procedure ImagexDblClick(Sender: TObject);" in private declarations, I get an unsatisfied forward declaration error.  When I move it below the private and public declarations, the program runs, but when I dblClick an image, nothing happens.

I declared Imagex as string which I know is not correct.  I it must be an object.

For reference below, I believe my error is on lines 3, 94, & 99.

I tried setting the Imagex :=  TImage.Name property.  That does not work.  

I'm confused on how to use Imagex  with the code I've written.

Thanks!
private
    { Private declarations }
    procedure ImagexDblClick(Sender: TObject);    //unsatisfied forward declaration error
  public
    { Public declarations }
  end;

-----------------------------------------
var
  fGallery: TfGallery;
  TabSheet : TTabSheet;
  scrlb : TScrollBox;
  img   : TImage;
  lbl   :TLabel;
...
implementation
{$R *.dfm}

-----------------------------------------

procedure ImagexDblClick(Sender: TObject);
var
   ImagexControlName:string;
begin
  ImagexControlName:=(sender as TImage).Name;
  ShowMessage('Call windows image fax viewer.');
end;

-----------------------------------------

procedure TfGallery.btnBuildLayersClick(Sender: TObject);
var
  i, j, idx,  iActLeft, iActTop, iNoImages, iNoCols, iNoImagesOnTab, iActImgInRow: integer;
  iLabelIdx : integer;
  strWork, strPathWork : string;
  Imagex  : string;
begin
  idx := 0;   
  iLabelIdx := 1;
  iNoCols := StrToInt(edImagesPerRow.Text);
  if ((iNoCols < 4) or (iNoCols  > 10)) then
  begin
    ShowMessage('Images Per row must be between 4 to 10.');
    Exit;
  end;

  strWork := Trim(edPathToImage.Text);
  if FileExists(strWork) then
    iNoImages := Load_Arrays(strWork);
  if iNoImages < 1 then  begin
    ShowMessage('No images to load from input file.');
    exit;
  end;

  for i := 0 to 4 do begin
    with  TTabSheet.Create(Self) do
    begin
      PageControl := PageControl1;
      PageControl1.ActivePageIndex := i;
      PageControl1.ActivePage := TabSheet;
      Parent := PageControl1;
      Visible := true;
      case i of
       0 : Caption := 'A - C';
       1 : Caption := 'D - F';
       2 : Caption := 'G - M';
       3 : Caption := 'N - S';
       4 : Caption := 'S - Z';
      end;

       //Add ScrollBox to each TabSheet
      scrlb := TScrollBox.Create(fGallery);
      with scrlb do begin
        PageControl1.ActivePageIndex := i;
        Parent :=PageControl1.ActivePage;
        Name := 'ScrollBox' + IntToStr(i);
        Color := clMedGray;
        Align := alClient;
        Visible := True;
      end;
    end;

    iActTop  := 4;
    iActLeft := 6;
    iActImgInRow := 1;
    iNoImagesOnTab := arNoThumbsOnTab[i]-1;
    for j := 0 to iNoImagesOnTab do begin

       img := TImage.Create(fGallery);
       with img do             // TImage.Create(Self)
       begin
         Parent := scrlb;
         Name   := 'Image'+ IntToStr(idx);
         Imagex:= Name;
         Width  := 105;
         Height := 160;
         Top    := iActTop;
         Left   := iActLeft;
         Imagex.OnDblClick := fGallery.ImagexDblClick;
         strPathWork := arPathFileName[idx];
         if FileExists(strPathWork)  then begin
           Picture.LoadFromFile(strPathWork);
         end else begin
           Picture.LoadFromFile('C:\tmp\Default.bmp');
         end;
         Refresh;
       end;

       with TLabel.Create(Self) do
       begin
         Parent := scrlb;
         Name   := 'Label' + IntToStr(iLabelIdx);
         Width  := 105;
         Height := 13;
         Top    := iActTop + 160 +2;
         Left   := iActLeft;
         Caption := 'Vacation  -  YYYY';//
         Inc(iLabelIdx);
       end;

       iActLeft := iActLeft + 125;
       Inc(iActImgInRow);
       Inc(idx);

       if iActImgInRow > iNoCols  then  begin
         iActTop := iActTop + 185; //Start a new row (down)
         iActLeft := 6;           //Reset column to first column
         iActImgInRow := 1;
       end;
    end;
  end;
   iActLeft := 6;
end;

Open in new window

EventHandler1.jpg
0
 
LVL 19

Expert Comment

by:Thommy
ID: 36558327
Your main form object is tfGallery. So if you place ImagexDblClick in its private section you will have to implement the procedure as a method of tfGallery:

procedure tfGallery.ImagexDblClick(Sender: TObject);
var
   ImagexControlName:string;
begin
  ImagexControlName:=(sender as TImage).Name;
  ShowMessage('Call windows image fax viewer.');
end;

0
 
LVL 19

Expert Comment

by:Thommy
ID: 36558508
How to dynamically create an image object and assign onDblClick event by object name...
unit Unit1;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, jpeg, ExtCtrls, StdCtrls;

type
  TForm1 = class(TForm)
    Button1: TButton;
    procedure FormCreate(Sender: TObject);
    procedure Button1Click(Sender: TObject);
  private
    { Private-Deklarationen }
    Image1: TImage;
    procedure ImagexDblClick(Sender:TObject);
  public
    { Public-Deklarationen }
  end;

var
  Form1: TForm1;

implementation

{$R *.dfm}

procedure TForm1.ImagexDblClick(Sender:TObject);
begin
  ShowMessage('Image double-clicked...');
end;

procedure TForm1.FormCreate(Sender: TObject);
begin
  Image1:=TImage.create(self);
  Image1.parent:=Form1;
  Image1.Name:='MyImage';
  Image1.Top:=0;
  Image1.Left:=0;
  Image1.AutoSize:=false;
  Image1.Width:=300;
  Image1.Height:=300;

  Image1.Picture.LoadFromFile('c:\...\xxx.JPG');  //your image file name
  //Image1.onDblclick:=ImagexDblClick;
  image1.Visible:=true;

end;

procedure TForm1.Button1Click(Sender: TObject);
begin
  (Form1.FindComponent('MyImage') as TImage).OnDblClick:=ImagexDblClick;
end;

end.

Open in new window

0
 
LVL 19

Expert Comment

by:Thommy
ID: 36558570
How to dynamically create multiple image objects and assign onDblClick events by object name...
unit Unit1;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, jpeg, ExtCtrls, StdCtrls;

type
  TForm1 = class(TForm)
    Button1: TButton;
    Button2: TButton;
    procedure Button1Click(Sender: TObject);
    procedure Button2Click(Sender: TObject);
  private
    { Private-Deklarationen }
    Image1: TImage;
    procedure ImagexDblClick(Sender:TObject);
  public
    { Public-Deklarationen }
  end;

var
  Form1: TForm1;

implementation

{$R *.dfm}

procedure TForm1.ImagexDblClick(Sender:TObject);
begin
  ShowMessage('Image '+(sender as TImage).Name+' double-clicked...');
end;

procedure TForm1.Button1Click(Sender: TObject);
var
  i: integer;
begin
  for i:=1 to 4 do begin
    (Form1.FindComponent('MyImage'+inttostr(i)) as TImage).OnDblClick:=ImagexDblClick;
  end;
end;

procedure TForm1.Button2Click(Sender: TObject);
var
  i: integer;
begin
  for i:=1 to 4 do begin
    Image1:=TImage.create(self);
    Image1.parent:=Form1;
    Image1.AutoSize:=false;
    Image1.Name:='MyImage'+inttostr(i);
    Image1.Top:=0;
    Image1.Left:=0+(i-1)*60;
    Image1.Width:=50;
    Image1.Height:=50;

    Image1.Picture.LoadFromFile('c:\swap\AXIS221.JPG');
    image1.Visible:=true;
  end;
end;

end.

Open in new window

0
 
LVL 1

Author Comment

by:IT79637
ID: 36562113
Thommy

I tried the program supplied.  I tweaked creating the images a little to fit the image I am using.  The images are created O.K. But when I click the other button or click an image, the ShowMessage(...) is not displayed.

Can you please help?

Thanks!
unit Unit1;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, jpeg, ExtCtrls, StdCtrls;

type
  TForm1 = class(TForm)
    Button1: TButton;
    Button2: TButton;
    procedure Button1Click(Sender: TObject);
    procedure Button2Click(Sender: TObject);
  private
    { Private-Deklarationen }
    Image1: TImage;
    procedure ImagexDblClick(Sender:TObject);
  public
    { Public-Deklarationen }
  end;

var
  Form1: TForm1;

implementation

{$R *.dfm}

procedure TForm1.ImagexDblClick(Sender:TObject);
begin
  ShowMessage('Image '+(sender as TImage).Name+' double-clicked...');
end;

procedure TForm1.Button1Click(Sender: TObject);
var
  i: integer;
begin
  for i:=1 to 4 do begin
    (Form1.FindComponent('MyImage'+inttostr(i)) as TImage).OnDblClick:=ImagexDblClick;
  end;
end;

procedure TForm1.Button2Click(Sender: TObject);
var
  i,iLeft: integer;
begin
  iLeft := 6;
  for i:=1 to 4 do begin
    Image1:=TImage.create(self);
    Image1.parent:=Form1;
    Image1.AutoSize:=false;
    Image1.Name:='MyImage'+inttostr(i);
    Image1.Top:=60;
    Image1.Left:= iLeft;
    Image1.Width:=105;
    Image1.Height:=160;
    Image1.Picture.LoadFromFile('c:\tmp\beach-ocean-tree.bmp');
    image1.Visible:=true;
    iLeft := iLeft +106+6;
  end;
end;
end.

Open in new window

Img2.jpg
beach-ocean-tree.bmp
0
 
LVL 1

Author Comment

by:IT79637
ID: 36562315
Your main form object is tfGallery. So if you place ImagexDblClick in its private section you will have to implement the procedure as a method of tfGallery:

procedure tfGallery.ImagexDblClick(Sender: TObject);
var
   ImagexControlName:string;
begin
  ImagexControlName:=(sender as TImage).Name;
  ShowMessage('Call windows image fax viewer.');
end;

After adding the "T" to fGallery (line 5), program compiles but dblClick on an image does nothing.  I don't know how to fix.  My code is below.

Thanks.
private
    { Private declarations }
      procedure ImagexDblClick (Sender: TObject);
--------------------------------------------------------
procedure tfGallery.ImagexDblClick(Sender: TObject);
var
   ImagexControlName:string;
begin
  ImagexControlName:=(sender as TImage).Name;
  ShowMessage('Call windows image fax viewer.');
end;
--------------------------------------------------------
procedure TfGallery.btnBuildLayersClick(Sender: TObject); // <<--fGallery to TfGallery
var
  i, j, idx,  iActLeft, iActTop, iNoImages, iNoCols, iNoImagesOnTab, iActImgInRow: integer;
  iLabelIdx : integer;
  strWork, strPathWork : string;
  //Imagex  : string;
begin
  idx := 0;   //Index into arPathFileName-0 to total images - 1
  iLabelIdx := 1;
  iNoCols := StrToInt(edImagesPerRow.Text);
  if ((iNoCols < 4) or (iNoCols  > 10)) then
  begin
    ShowMessage('Images Per row must be between 4 to 10.');
    Exit;
  end;

  strWork := Trim(Vacation.Text);
  if FileExists(strWork) then
    iNoImages := Load_Arrays(strWork);
  if iNoImages < 1 then  begin
    ShowMessage('No images to load from input file.');
    exit;
  end;

  for i := 0 to 4 do begin
    with  TTabSheet.Create(Self) do
    begin
      PageControl := PageControl1;
      PageControl1.ActivePageIndex := i;
      PageControl1.ActivePage := TabSheet;
      Parent := PageControl1;
      Visible := true;
      case i of
       0 : Caption := 'A - C';
       1 : Caption := 'D - F';
       2 : Caption := 'G - M';
       3 : Caption := 'N - S';
       4 : Caption := 'S - Z';
      end;

       //Add ScrollBox to each TabSheet
      scrlb := TScrollBox.Create(fGallery);
      with scrlb do begin
        PageControl1.ActivePageIndex := i;
        Parent :=PageControl1.ActivePage;
        Name := 'ScrollBox' + IntToStr(i);
        Color := clMedGray;
        Align := alClient;
        Visible := True;
      end;
    end;

    iActTop  := 4;
    iActLeft := 6;
    iActImgInRow := 1;
    iNoImagesOnTab := arNoThumbsOnTab[i]-1;
    for j := 0 to iNoImagesOnTab do begin

       Imagex := TImage.Create(fGallery);
       with Imagex do             // TImage.Create(Self)
       begin
         Parent := scrlb;
         Name   := 'Image'+ IntToStr(idx);
         Width  := 105;
         Height := 160;
         Top    := iActTop;
         Left   := iActLeft;
         Imagex.OnDblClick := fGallery.OnDblClick;
         strPathWork := arPathFileName[idx];
         if FileExists(strPathWork)  then begin
           Picture.LoadFromFile('C"\tmp\beach-ocean-tree.bmp');
         end else begin
           Picture.LoadFromFile('C:\tmp\Default.bmp');
         end;
         Refresh;
       end;

       with TLabel.Create(Self) do
       begin
         Parent := scrlb;
         Name   := 'Label' + IntToStr(iLabelIdx);
         Width  := 105;
         Height := 13;
         Top    := iActTop + 160 +2;
         Left   := iActLeft;
         Caption :=  'Vacation  -  YYYY';//
         Inc(iLabelIdx);
       end;

       iActLeft := iActLeft + 125;
       Inc(iActImgInRow);
       Inc(idx);

       if iActImgInRow > iNoCols  then  begin
         iActTop := iActTop + 185; //Start a new row (down)
         iActLeft := 6;            //Reset to first column
         iActImgInRow := 1;
       end;
    end;
  end;
   iActLeft := 6;
   PageControl1.ActivePageIndex:=0;
end;

Open in new window

0
 
LVL 19

Expert Comment

by:Thommy
ID: 36565117
In your "tweaked" demo OnDblClick-event is assigned after clicking button1 (Event handler):

procedure TForm1.Button1Click(Sender: TObject);
var
  i: integer;
begin
  for i:=1 to 4 do begin
    (Form1.FindComponent('MyImage'+inttostr(i)) as TImage).OnDblClick:=ImagexDblClick;
  end;
end;


You can also omit Button1 and Button1Click and assign event handler directly after creating TImage objects in Button2Click...

(Form1.FindComponent('MyImage'+inttostr(i)) as TImage).OnDblClick:=ImagexDblClick;



First click button1 and then you should see the showmessage(..) when double-clicking the images.
unit Unit1;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, jpeg, ExtCtrls, StdCtrls;

type
  TForm1 = class(TForm)
    Button2: TButton;
    procedure Button2Click(Sender: TObject);
  private
    { Private-Deklarationen }
    Image1: TImage;
    procedure ImagexDblClick(Sender:TObject);
  public
    { Public-Deklarationen }
  end;

var
  Form1: TForm1;

implementation

{$R *.dfm}

procedure TForm1.ImagexDblClick(Sender:TObject);
begin
  ShowMessage('Image '+(sender as TImage).Name+' double-clicked...');
end;

procedure TForm1.Button2Click(Sender: TObject);
var
  i,iLeft: integer;
begin
  iLeft := 6;
  for i:=1 to 4 do begin
    Image1:=TImage.create(self);
    Image1.parent:=Form1;
    Image1.AutoSize:=false;
    Image1.Name:='MyImage'+inttostr(i);
    Image1.Top:=60;
    Image1.Left:= iLeft;
    Image1.Width:=105;
    Image1.Height:=160;
    Image1.Picture.LoadFromFile('c:\tmp\beach-ocean-tree.bmp');
    image1.Visible:=true;
    iLeft := iLeft +106+6;
    (Form1.FindComponent('MyImage'+inttostr(i)) as TImage).OnDblClick:=ImagexDblClick;
  end;
end;

end.

Open in new window

0
 
LVL 19

Accepted Solution

by:
Thommy earned 500 total points
ID: 36565149
In your code please replace line

Imagex.OnDblClick := fGallery.OnDblClick;

with

Imagex.OnDblClick := fGallery.ImagexDblClick;


Imagex.OnDblClick := fGallery.OnDblClick; means, that you set the OnDblClick event of your TImage to the same event handler as the OnDblClick event of your main form (fGallery).
This makes no sense and nothing happens, because fGallery.OnDblClick is not assigned and therefore imagex.OnDblClick is unassigned too...
private
    { Private declarations }
      procedure ImagexDblClick (Sender: TObject);
--------------------------------------------------------
procedure tfGallery.ImagexDblClick(Sender: TObject);
var
   ImagexControlName:string;
begin
  ImagexControlName:=(sender as TImage).Name;
  ShowMessage('Call windows image fax viewer.');
end;
--------------------------------------------------------
procedure TfGallery.btnBuildLayersClick(Sender: TObject); // <<--fGallery to TfGallery
var
  i, j, idx,  iActLeft, iActTop, iNoImages, iNoCols, iNoImagesOnTab, iActImgInRow: integer;
  iLabelIdx : integer;
  strWork, strPathWork : string;
  //Imagex  : string;
begin
  idx := 0;   //Index into arPathFileName-0 to total images - 1
  iLabelIdx := 1;
  iNoCols := StrToInt(edImagesPerRow.Text);
  if ((iNoCols < 4) or (iNoCols  > 10)) then
  begin
    ShowMessage('Images Per row must be between 4 to 10.');
    Exit;
  end;

  strWork := Trim(Vacation.Text);
  if FileExists(strWork) then
    iNoImages := Load_Arrays(strWork);
  if iNoImages < 1 then  begin
    ShowMessage('No images to load from input file.');
    exit;
  end;

  for i := 0 to 4 do begin
    with  TTabSheet.Create(Self) do
    begin
      PageControl := PageControl1;
      PageControl1.ActivePageIndex := i;
      PageControl1.ActivePage := TabSheet;
      Parent := PageControl1;
      Visible := true;
      case i of
       0 : Caption := 'A - C';
       1 : Caption := 'D - F';
       2 : Caption := 'G - M';
       3 : Caption := 'N - S';
       4 : Caption := 'S - Z';
      end;

       //Add ScrollBox to each TabSheet
      scrlb := TScrollBox.Create(fGallery);
      with scrlb do begin
        PageControl1.ActivePageIndex := i;
        Parent :=PageControl1.ActivePage;
        Name := 'ScrollBox' + IntToStr(i);
        Color := clMedGray;
        Align := alClient;
        Visible := True;
      end;
    end;

    iActTop  := 4;
    iActLeft := 6;
    iActImgInRow := 1;
    iNoImagesOnTab := arNoThumbsOnTab[i]-1;
    for j := 0 to iNoImagesOnTab do begin

       Imagex := TImage.Create(fGallery);
       with Imagex do             // TImage.Create(Self)
       begin
         Parent := scrlb;
         Name   := 'Image'+ IntToStr(idx);
         Width  := 105;
         Height := 160;
         Top    := iActTop;
         Left   := iActLeft;
         Imagex.OnDblClick := fGallery.ImagexDblClick;
         strPathWork := arPathFileName[idx];
         if FileExists(strPathWork)  then begin
           Picture.LoadFromFile('C"\tmp\beach-ocean-tree.bmp');
         end else begin
           Picture.LoadFromFile('C:\tmp\Default.bmp');
         end;
         Refresh;
       end;

       with TLabel.Create(Self) do
       begin
         Parent := scrlb;
         Name   := 'Label' + IntToStr(iLabelIdx);
         Width  := 105;
         Height := 13;
         Top    := iActTop + 160 +2;
         Left   := iActLeft;
         Caption :=  'Vacation  -  YYYY';//
         Inc(iLabelIdx);
       end;

       iActLeft := iActLeft + 125;
       Inc(iActImgInRow);
       Inc(idx);

       if iActImgInRow > iNoCols  then  begin
         iActTop := iActTop + 185; //Start a new row (down)
         iActLeft := 6;            //Reset to first column
         iActImgInRow := 1;
       end;
    end;
  end;
   iActLeft := 6;
   PageControl1.ActivePageIndex:=0;
end;

Open in new window

0
 
LVL 1

Author Closing Comment

by:IT79637
ID: 36567751
I replaced the line of code and it worked.

Thank you very much for your help!!!
0
 
LVL 19

Expert Comment

by:Thommy
ID: 36570051
Thank you for the points...
:o)))
0

Featured Post

U.S. Department of Agriculture and Acronis Access

With the new era of mobile computing, smartphones and tablets, wireless communications and cloud services, the USDA sought to take advantage of a mobilized workforce and the blurring lines between personal and corporate computing resources.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Issue: Unstable cursor in Windows XP and Windows runs extremely slow in that any click will bring up the Hour glass (sometimes for several seconds before giving you what you want) . Troubleshooting Process and the FINAL FIX: This issue see…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…

777 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question