TAL Programmer's Guide

Formatting Programs
Structuring Programs
096254 Tandem Computers Incorporated 3–15
Skipping Parts of Code
When you want the compiler to ignore a portion of the code, you can either:
Comment it out
Use conditional compilation
For example, when your code contains ! comments, you can use -- to comment
out the portion you want the compiler to ignore:
PROC my_proc;
BEGIN
!Lots of code
END;
--Comment out the following portion of code:
--PROC no_proc;
-- BEGIN
-- !Lots of code
-- END;
--End of commented-out portion of code
PROC your_proc;
BEGIN
!Lots of code
END;
Alternatively, you can use conditional compilation for the portion you want the
compiler to ignore. Here is the preceding example shown with the DEFINETOG , IF,
and ENDIF conditional compilation directives:
PROC my_proc;
BEGIN
!Lots of code
END;
?DEFINETOG omit !Define toggle OMIT without
! changing its off state
?IF omit !If OMIT is off,
PROC this_proc; ! skip THIS_PROC
BEGIN
!Lots of code
END;
?ENDIF omit !End of skipped portion
PROC your_proc;
BEGIN
!Lots of code
END;
In the preceding example, DEFINETOG and named toggles are D20 or later features.
For pre-D20 systems, you can use RESETTOG with numeric toggles instead. For more
information on these directives, see the TAL Reference Manual.