Declare for Proc compilation without being used in code?

Started by trastikata, Jun 21, 2024, 07:01 AM

Previous topic - Next topic

trastikata

Hi,

I remember there was a Declare that would force the compiler to include and compile all procedures regardless whether they have been used or not.

However I can't remember nor find the actual Declare, anyone knows it?

Thanks

top204

The declare was not to enable all procedures, it will allow a named procedure to be enabled, regardless whether it is used or not.

I cannot remember why I added it to the compiler, but looking at the source code for it, it looks as though it was a request from a user, because the mechanism is actually immitating a procedure call from the program, and this is the only way it can be done.

To use it, use:

Declare Proc_Enable _CPROC_ MyProc

The _CPROC_ text before the procedure's name, immitates what the compiler does before all procedure calls in a program when it is being initially scanned for the procedures and their calls, so it immitates the procedure name being used in the program listing, so the scanner will include it in the program's listing.

Making all procedures active would not be possible with a declare, because they are scanned and stored before the parser actually looks at the details of the code.