qse/ase/cmd/awk/simple-003.out
2008-03-21 03:49:53 +00:00

34 lines
336 B
Plaintext

function error ()
{
exit 200;
}
function getx ()
{
if ((x == 2))
error ();
return (x)++;
}
function gety ()
{
return (y)++;
}
BEGIN {
x = 0;
y = 0;
print (getx () + gety ());
print (getx () + gety ());
print (getx () + gety ());
print (getx () + gety ());
}
END {
print "END OF PROGRAM";
exit 20;
}
0
2
END OF PROGRAM