Atozed Forums
WebApplication.FormCount - Printable Version

+- Atozed Forums (https://www.atozed.com/forums)
+-- Forum: Atozed Software Products (https://www.atozed.com/forums/forum-1.html)
+--- Forum: IntraWeb (https://www.atozed.com/forums/forum-3.html)
+---- Forum: English (https://www.atozed.com/forums/forum-16.html)
+----- Forum: IntraWeb General Discussion (https://www.atozed.com/forums/forum-4.html)
+----- Thread: WebApplication.FormCount (/thread-141.html)



WebApplication.FormCount - cyracks - 05-01-2018

Hello,

could you please help me on how to iterate over all forms included in the application.

Code:
// for i:=0 to UserSession.WebApplication.FormCount-1 do
for i:=0 to WebApplication.FormCount-1 do
begin
   OutputDebugString(PChar(WebApplication.Forms[i].Name));
end;

Code above lists only active or already opened forms. Forms that were not opened are not listed.


Regards, 
Tomaž


RE: WebApplication.FormCount - kudzu - 05-01-2018

Delphi does not keep track of all classes like .NET and other frameworks. If a class exists in definition only (ie no instance), you have to make a list yourself or use RegisterClass for each one so that it can be "found".