J Jack Howard Member Licensed User Longtime User May 14, 2017 #1 I am new to using inline Java. I have a couple of routines working. But I don't seem able to get the Try catch Syntax correct. public int Cam2_Test() { BA.Log("Cam2_Test START"); Int_Test_Result=0; String_Test_Result =null; // manager = (CameraManager) getSystemService(Context.CAMERA_SERVICE); Try { String_Test_Result = "T1"; // manager.getCameraIdList()[0]; // } Catch //(CameraAccessException e) { }catch(Exception e){ // String_Test_Result ="Failed"; BA.Log("Crash"); // //e.printStackTrace(); } BA.Log("Cam2_Test END"); BA.Log(String_Test_Result); return Int_Test_Result; } On the try line I get src\anywheresoftware\b4a\samples\camera\main.java:580: error: not a statement
I am new to using inline Java. I have a couple of routines working. But I don't seem able to get the Try catch Syntax correct. public int Cam2_Test() { BA.Log("Cam2_Test START"); Int_Test_Result=0; String_Test_Result =null; // manager = (CameraManager) getSystemService(Context.CAMERA_SERVICE); Try { String_Test_Result = "T1"; // manager.getCameraIdList()[0]; // } Catch //(CameraAccessException e) { }catch(Exception e){ // String_Test_Result ="Failed"; BA.Log("Crash"); // //e.printStackTrace(); } BA.Log("Cam2_Test END"); BA.Log(String_Test_Result); return Int_Test_Result; } On the try line I get src\anywheresoftware\b4a\samples\camera\main.java:580: error: not a statement
R Roycefer Well-Known Member Licensed User Longtime User May 14, 2017 #2 Code: Copy Try should be lower-cased. Upvote 0
J Jack Howard Member Licensed User Longtime User May 15, 2017 #3 Thanks Roycefer, the help on this forum and Erels examples really helps us starters, I just need to "TRY" harder in Java Upvote 0
Thanks Roycefer, the help on this forum and Erels examples really helps us starters, I just need to "TRY" harder in Java