home *** CD-ROM | disk | FTP | other *** search
/ Mac-Source 1994 July / Mac-Source_July_1994.iso / Pascal / Utilities / Snippets / ife < prev    next >
Encoding:
Text File  |  1992-08-12  |  605 b   |  18 lines  |  [TEXT/MPS ]

  1. #if/else template. for implementations only
  2. # © G. Sawitzki, StatLab Heidelberg 1992 <gs@statlab.uni-heidelberg.de>
  3. #usage: ife a
  4. set a1 "`catenate "{active}".§`"
  5. #set a1 > temp
  6. if "{a1}" == "" #empty selection so far
  7. find ¡1 "{Active}" # get the full current line
  8. end
  9. (echo 'if  then { '{"parameters"}' }'∂nbegin '{ if '{"parameters"}' }'∂n∂t∂nend '{ if '{"parameters"}' }' else '{ not '{"parameters"}' }'∂nbegin∂n∂t∂nend';''{ not '{"parameters"}' }'
  10. )> "{Active}".§     #rewrite selection
  11. find  Δ§ "{Active}"    #move selection to arguments
  12. find / then/ "{Active}"
  13. find  Δ§ "{Active}"
  14.  
  15. unset procname
  16.  
  17. exit 0
  18.