Calling procedure name generator from Source template

Top  Previous  Next

Some code needs to be executed on each procedure so FullRecord knows the name of the procedure. On "source" type procedures the template generator cannot "execute" the code as there is only one embed for code execution and it's yours. So if you are going to audit files in a source procedure, you may want to call the "procedure name" arm and disarm routines, as follows:

 

 DO JAL_InitProcName  !Arm the procedure name generator

 !Your code

 DO JAL_KillProcName   !Disarm the procedure name generator

 

For example, the following code is valid and audited in a source procedure:

 

 DO OpenFiles

 DO JAL_InitProcName

 Clear(PEO:Record)

 PEO:FirstName = 'Jorge'

 PEO:LastName = 'Lavera'

 If Access:People.PrimeRecord(1)

 Else

   PEO:CivilState = 'M'

   PEO:Gender = 'M'

   If Access:People.Insert()

      Access:People.CancelAutoInc()

   End

 End

 DO JAL_KillProcName

 DO CloseFiles

 

Note: If you forget to add these "arm" and "disarm" calls, the auditing will occur anyway, but the procedure name will be wrong in the audit file, for the operations made in this source procedure.

 

You can avoid the code generation of these routines using the checkbox in the local extension.