Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Must_include in subroutine failing validation before subroutine is called

The first tab in my reload script has a subroutine containing a must_include. The next tab contains

calls to the subroutine passing the name of the file to include.

This has been  working with no problems in a V11 environment.

When I copied to a V12 environment and reload I get an error message

$MUST_INCLUDE failed.

followed by a pathname which does not include a filename.

If I answer ok to the message the reload continues and completes successfully

When I step it through in debug it shows

SUB name of first subroutine which does not contain a must_include

END SUB

SUB name of the second subroutine which does contain a must_include

the error message $(MUST_INCLUDE failed

END SUB

the code in the second tab is then executed correctly including the call to the subroutine containing must_include

It appears the must_include in the subroutine is being validated before the subroutine is called so the filename is not set and therefore invalid.

If I change the must_include to an include it runs with no error message.

Is this a V12 issue or is there some setting for validation I should know about

2 Replies
marcus_sommer

Must_Include is something special. I had experienced a case that the must_include was executed even after an exit script statement and therefore I think it will be bypassed from the interpreter and always executed. If there is no other solution I would change the statement to normal include-statement maybe embedded within a small if-loop which checked per filesize() if the file exists and if not exit the script or produce an error.

- Marcus

Not applicable
Author

Marcus I have done as you suggested. I will remember not to write subroutines containing Must_Include