Find Window Variable

Question: "How can I get the Window variable set so I can use ChartReplace to replace the charts in windows I have found by going through Screen.Forms?  It seems that there is no way to do this.  Basically, I would like to change the charts in 2 or 3 windows which I will identify by their background color or other unique feature I will set.  The symbol for the charts will be taken from a Quote window using one of the  Who=0..9 menu choices."

Answer:  Here is an example of finding some characteristic of a window, and then assigning the Window variable:

var
  f: TForm;
  j: integer;
begin
  for j := 0 to pred(MDIChildCount) do begin
    f := screen.forms[ j ];
    writeln( f.caption );
    if pos('SF0Z.D',f.caption)>0 then begin
      Window:=j+1;
      ChartReplace('SP0Z.5');
    end;
  end;
end;