TAA Tools
CLPSUBR         CLP SUBROUTINE                         TAASUBA

       **********************************************************
       *                                                        *
       *    The system now supports a native method in the      *
       *       CL compiler.  This tool is retained for          *
       *       code that used the technique previously.         *
       *                                                        *
       **********************************************************

The CLP  Subroutine tool has  no source  other than this  documentation
member.  The  intent is that you would access  this member from the SEU
browse function and copy in the code when you needed a subroutine.

The  source is  in the proper  format to be  copied into  a CL program.
To copy  the  source  from this  documentation  member to  QATTINFO  in
TAATOOL, do  CPYTAATOOL TAAARCMBR(CLPSUBR).   You must  do a  RETURN to
prevent from falling into the subroutine code.

The following is the code:

             /* Technique for a CLP subroutine */
             DCL        &RTNLOC *CHAR LEN(10)
                        /* 1st point where you need subr */
             CHGVAR     &RTNLOC 'LOC1'
             GOTO       SUBR
 LOC1:                  /* Return location */
                        /* 2nd point where you need subr */
             CHGVAR     &RTNLOC 'LOC2'
             GOTO       SUBR
 LOC2:                  /* Return location */
                        /* 3rd point where you need subr */
             CHGVAR     &RTNLOC 'LOC3'
             GOTO       SUBR
 LOC3:                  /* Return location */
                        /*     Be sure to do a RETURN             */
                        /******************************************/
                        /*                                        */
 STRSUBR:               /*     Beginning of subroutine code       */
                        /*                                        */
                        /******************************************/
             SNDESCMSG  MSG('Programmer error. You have +
                          fallen into the subr code +
                          instead of a GOTO')
                        /******************************************/
                        /*                                        */
 SUBR:                  /*     Beginning of common code           */
                        /*                                        */
                        /******************************************/
                        /*                                       */

                        /*         Insert your code              */
                        /*                                       */
                        /******************************************/
                        /*                                        */
                        /*     End of common code, branch back    */
                        /*                                        */
                        /******************************************/
             IF         (&RTNLOC *EQ 'LOC1') GOTO LOC1
             IF         (&RTNLOC *EQ 'LOC2') GOTO LOC2
             IF         (&RTNLOC *EQ 'LOC3') GOTO LOC3
             SNDESCMSG  MSG('Bad RTNLOC value of ' *CAT +
                          &RTNLOC *TCAT ' in SUBR routine')
                        /* End of subroutine code               */

Note  how the code  protects you if  you fall into  the subroutine (you
do not do a GOTO SUBR or if your RTNLOC is incorrect.

Command parameters                                    *CMD
------------------

None.

Restrictions
------------

None.

Prerequisites
-------------

None.

Implementation
--------------

None.  To allow  a simple SEU copy function,  you should use CPYTAA  to
place the documentation in a source member.

Objects used by the tool
------------------------

None.
					

Added to TAA Productivity tools April 1, 1995


Home Page Up to Top