[DUG] New User Of Delphi

Dennis Chuah dennis_cs_chuah at hotmail.com
Mon Mar 26 08:29:07 NZST 2007


Bob,

Hi.  It would depend on your skill level, eg. whether you are new to Delphi, 
or new to Programming altogether.  So to start with, this is going to be 
pretty general, and you can ask questions about the specifics.  Bear also in 
mind, there are many ways to do the same thing.

1.  Read the list of TImage names into a TStringList.
2.  Handle the OnClick event of the TImage - you can probably use the same 
handler for all the TImage components.
3.  In the handler, check TComponent (Sender).Name against the TStringList. 
You probably need to have a form level counter that is initialised to 0 - to 
represent the first item on the TStringList.
4.  Increment this counter as the user clicks on the TImage in the correct 
sequence.  An out of sequence click could set the counter back to 0.

Example code:

// Form variables
FImageNames: TStringList;
FClickIndex: Integer; // Counter

// In the OnClick
if TComponent (Sender).Name = FImageNames[FClickIndex] then
  Inc (FClickIndex)
else
  FClickINdex := 0;

Remember to create the TStringList in the FormCreate and free it in the 
FormDestroy.

HTH.

Regards,
Dennis.

----- Original Message ----- 
From: "Bob Pawley" <rjpawley at shaw.ca>
To: <delphi at ns3.123.net.nz>
Sent: Monday, March 26, 2007 6:27 AM
Subject: [DUG] New User Of Delphi


Hi

I've just joined your list and am seeking help.

I have an existing application that performs a particular sequence of events 
when the user clicks a series of TImages.

I also have a newly developed PostgreSQL database that generates a column 
that lists the names of the required TImages.

I want to trigger the image sequence in Delphi from the list developed in 
PostgreSql.

What do you need to know from me to provide help??

Bob Pawley


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


> _______________________________________________
> Delphi mailing list
> Delphi at ns3.123.net.nz
> http://ns3.123.co.nz/mailman/listinfo/delphi
> 



More information about the Delphi mailing list