home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Mac-Source 1994 July
/
Mac-Source_July_1994.iso
/
Pascal
/
Utilities
/
Snippets
/
ife
< prev
next >
Encoding:
Amiga (detected)
Atari
Commodore
DOS
FM Towns/JPY
Macintosh
Macintosh JP
Macintosh to JP
NeXTSTEP
RISC OS/Acorn
Shift JIS
UTF-8
Wrap
Text File
|
1992-08-12
|
605 b
|
18 lines
|
[
TEXT/MPS
]
#if/else template. for implementations only
# © G. Sawitzki, StatLab Heidelberg 1992 <gs@statlab.uni-heidelberg.de>
#usage: ife a
set a1 "`catenate "{active}".§`"
#set a1 > temp
if "{a1}" == "" #empty selection so far
find ¡1 "{Active}" # get the full current line
end
(echo 'if then { '{"parameters"}' }'∂nbegin '{ if '{"parameters"}' }'∂n∂t∂nend '{ if '{"parameters"}' }' else '{ not '{"parameters"}' }'∂nbegin∂n∂t∂nend';''{ not '{"parameters"}' }'
)> "{Active}".§ #rewrite selection
find Δ§ "{Active}" #move selection to arguments
find / then/ "{Active}"
find Δ§ "{Active}"
unset procname
exit 0