next up previous contents
Next: Creating Histograms Up: Jumping and Copying Previous: A Word of Caution   Contents

Maintaining Readabilty

Despite the warnings above there may be times, particularly when using this n-tuple syntax to write FLTR banks (see section 9.1), when quite complicated expressions may be unavoidable. With a little effort is should be possible to keep such banks readable. Consider this FORTRAN fragment:-

      if ( flag .lt. 1 ) then

*       Deal with flag < 1
        ...

      elseif ( flag .eq. 1 ) then

*       Deal with flag = 1
        ...

      else

*       All other cases come here.
        ...

*     endif
in n-tuple syntax, this could be written:-
'_flag_if:
'          lt            flag, 1;           '
'_         jump_false    _flag_elseif;      '

#.           Deal with flag < 1
             ...

'_           jump  flag_endif;              '
'_flag_elseif:           
'-         eq            flag, 1;           '
'-         jump_false    _flag_else;        '        

#.           Deal with flag = 1
             ...

'            jump flag_endif;               '
'_flag_else:                                '

#.           All other cases come here.
             ...

'_flag_endif:                               '
The initial _flag_if: doesn't do anything except indicate the start of an IF-THEN-ELSE-CONSTRUCT with the remaining sections marked by _flag_* labels.



sno Guest Acct 2009-09-09