qse/ase/test/awk/simple-005.out
2007-12-08 00:24:28 +00:00

39 lines
402 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";
return 10;
}
END {
print "END OF PROGRAM 2";
return 20;
}
0
2
END OF PROGRAM
END OF PROGRAM 2