Procedure TMAINFORM.ACTIONNEWEXECUTE (Sender: TOBJECT);
Var OldChildform, NewChildform: tchildform; // tchildform is a self-built subscription class
begin OldChildForm: = TChildForm (ActiveMDIChild); // get the current active child window Inc (Counter); NewChildForm: = TChildForm.Create (Self); NewChildForm.Caption: = LowerCase (ExtractFilePath (Application.Exename)) 'text' INTTOSTR (Counter) '.txt'; if Assigned (OldChildform) Then OldChildform.show // Re-displays the old window Else NewChildform.Show;
END;