Powering through statements
-
Basically, i dont care if a set of statements throws an exception but i dont want the program flow to be interupted. How can i do this? Something like the following:
int[] manyInts = new int[4]; manyInts[0] = 1; manyInts[1] = 1; manyInts[2] = 1; manyInts[3] = 1; manyInts[4] = 1; manyInts[5] = 1;
So basically it executes every statement whether it thows an exception or not. -- ABT -
Basically, i dont care if a set of statements throws an exception but i dont want the program flow to be interupted. How can i do this? Something like the following:
int[] manyInts = new int[4]; manyInts[0] = 1; manyInts[1] = 1; manyInts[2] = 1; manyInts[3] = 1; manyInts[4] = 1; manyInts[5] = 1;
So basically it executes every statement whether it thows an exception or not. -- ABTHow about:
try //Outside try block to handle initialization and leave the array visible
{
int[] manyInts = new int[4];try {manyInts\[0\] = 1;} catch {/\*Empty catch block does nothing\*/} try {manyInts\[1\] = 1;} catch {} try {manyInts\[2\] = 1;} catch {} try {manyInts\[3\] = 1;} catch {} try {manyInts\[4\] = 1;} catch {} try {manyInts\[5\] = 1;} catch {}
}
catch {}...Powerful kludgy - but should work
α.γεεκ
Fortune passes everywhere.
Duke Leto Atreides -
How about:
try //Outside try block to handle initialization and leave the array visible
{
int[] manyInts = new int[4];try {manyInts\[0\] = 1;} catch {/\*Empty catch block does nothing\*/} try {manyInts\[1\] = 1;} catch {} try {manyInts\[2\] = 1;} catch {} try {manyInts\[3\] = 1;} catch {} try {manyInts\[4\] = 1;} catch {} try {manyInts\[5\] = 1;} catch {}
}
catch {}...Powerful kludgy - but should work
α.γεεκ
Fortune passes everywhere.
Duke Leto AtreidesHA. :-D That is extactly the work around that i am using.
-
HA. :-D That is extactly the work around that i am using.
Sprinkle liberally with cheese and enjoy.
α.γεεκ
Fortune passes everywhere.
Duke Leto Atreides