PC SOFT

FORUMS PROFESSIONNELS
WINDEVWEBDEV et WINDEV Mobile

Accueil → WINDEV 2024 → [WD19] How to test for existence of procedures, reports, windows etc?
[WD19] How to test for existence of procedures, reports, windows etc?
Débuté par Ola, 28 sep. 2014 10:22 - 3 réponses
Posté le 28 septembre 2014 - 10:22
How can I test for the existence of procedures, reports, windows and other WD elements?

Something like this:

FileName is string = "CONTACT" ReportName is string = "R_" + Filename + "_TBL" IF ElementExist ({ReportName,IndReport}) then //... or: IF ReportExist (ReportName) then (etc...) iPreview(100) iPrintReport(ReportName) ELSE Info("This report has not yet been programmed.") ReturnToCapture() END
I cannot find anything like this in the help.
Is it currently possible? If yes, how?

best regards
Ola
Posté le 28 septembre 2014 - 11:54
Hi. For windows, report and others, EnumElement with some parameter can do the job.
But it doesn't work for procedures...

Regards,
José Antonio.
Posté le 28 septembre 2014 - 14:12
Hello !

For test procedure ....

ProcedureName is string
ProcedureCall is PROCEDURE

ProcedureName = "proc1"
ProcedureCall = SeekProcedure(ProcedureName)

IF ProcedureCall = Null THEN
Info("Procedure not found: " + Upper(ProcedureName))
ELSE
ProcedureCall()
END
Posté le 28 septembre 2014 - 23:08
Hi Jose & Igor

Many thanks to both of you!

With your help I was able to build a general purpose
"ExistElement" function which checks for the existence of
reports, windows, queries, external components and procedures.:cheers:

best regards
Ola