try-catch in if?
in
Programming Questions
•
1 year ago
Hi,
I want to check the conntected Clients to my windows7-pc.
So I wrote in my sketch:
if (address.isReachable(1000))
{
println("Can be pinged");
}
but I got an error that told me to use try-catch.
I thought of:
if (try {
address.isReachable(1000);
}
catch(Exception e) {
}
)
{
println(address + " machine is turned on and can be pinged");
}
)
But I get:" unexpect token: try"
It still doesnt work.
Help!
1