class WrongTypeException : exception
{
method WrongTypeException() { Error = 1; }
method WrongTypeException(int error) { Error = error; }
method int getError() { return Error; }
int Error;
}
function string main(const string[] args)
{
int[] values = { 10, 20, 30 };
string[] names = { "Judy", "Christopher", "Helen", "James", "Sandra", "Rick", "Elisabeth", "Johnboy" };
values = values.process( Incrementor, null );
names = names.process ( Incrementor, null );
return new string("We will never get here");
}
function var Incrementor(const var element, var args)
{
if( typeof(element) != typeof(int) )
throw new WrongTypeException();
return element + 1;
}