Hello, Pierre Phaneuf! You wrote:
On Fri, 30 May 1997, The African Chief wrote:
for i := 1 to GetObjectCount do begin p := InstanceFromSelfID ( i ); If Assigned ( p ) then begin If p^.Name = 'CHIEFDIALOG' then { blah blah } else If p^.Name = 'CHIEFCONTROL' then {blah blah} else {blah blah}; end; end;
(assuming a little change that the aList object moves to the interface section)
var P: PListUnit; begin P:=aList.Head; while assigned(P) do begin case typeof(P^.TheObject^) of typeof(CHIEFDIALOG): { blah blah } typeof(CHIEFCONTROL): { blah blah } otherwise { blah blah } end; end;
Plus or minus a few possible bugs, this would do exactly what you did, without either the SelfID or the Name.
Sure. And it could probably be done in many other ways too. However, I chose the first method.
Warmest regards, The Chief --------- Dr. Abimbola A. Olowofoyeku (The African Chief and The Great Elephant) Keele University, England (Email: laa12@cc.keele.ac.uk) Author of: Chief's Installer Pro v3.50 for Win16 and Win32 Homepage: http://ourworld.compuserve.com/homepages/African_Chief/