View Single Post
Old 07-18-2007   #3 (permalink)
Kiron
Guest


 
 

Re: PSH Guru needed ! : Trapping terminating errors

The trap works when division by a variable which's value is zero.
I'm no guru though

$zero = 0
trap { "Got it : division by zero !" } 1/$zero; "next"

....or in the pipe:
1,6,9,0 | foreach-object {trap { "Got it : division by zero !" } 1/$_ };
"next"

--
Kiron

My System SpecsSystem Spec