Welcome to the SRP Forum! Please refer to the SRP Forum FAQ post if you have any questions regarding how the forum works.
Re-Compile ALL Forms
I was wondering if anyone knew of a way to re-compile all forms in an application. I removed some promoted event handlers and now need to compile all the forms in the application again to complete the process. I really don't feel like opening each form in the Form Designer and hitting save -- one by one....
Comments
From this form you can just double click on each form to compile or do a tree compile as well.
Function
SCRATCH_RECOMPILE_FORMS(VOID)
Declare
Function
Get_Repos_Entities,Repository,DCOUNT
$
Insert
Logical
StatusCode =
0
AppID =
@APPID
<
1
>
TypeID =
"OIWIN"
ClassID =
""
*Get and count number of OIWIN entities in repository for current application
EntList = Get_Repos_Entities(AppID, TypeID, ClassID,
""
,
""
,
""
,
""
)
EntListCount = DCOUNT(EntList,
@FM
)
CompileErrs =
''
;* Store a list of entities that failed
to
compile
For
i =
1
To
EntListCount
// Repository COMPILE all forms to clear out any related promoted event references.
rv = Set_Status(
0
)
FormID = EntList<i>
rv = Repository(
'COMPILE'
, FormID,
True$
,
False$
)
Status = Get_Status(StatusCode)
If
Status
then
Convert
@FM
to
@VM
in
StatusCode
CompileErrs := FormID :
@VM
: StatusCode :
@FM
end
Next
i
If
Len(CompileErrs)
then
CompileErrs =
@FM
: CompileErrs
Swap
@FM
with
\0D0A\
:
'* '
in
CompileErrs
Swap
@VM
with
\0D0A\
:
'** '
in
CompileErrs
OSWrite
CompileErrs
to
'C:\temp\'
: AppID :
' CompileErrs.txt'
end