Android Question Try-Catch are several levels possible here?

Tempomaster

Active Member
Licensed User
Longtime User
Hello,

one of my apps has the following problem:

B4X:
Try
                    
Catch
   ' Another problem can occur in this segment
End Try

I could solve that with this construction:

B4X:
Try
                    
Catch
   Try
                        
   Catch    
                        
   End Try
End Try

I am not sure if this can be programmed. Or could that cause problems?

Best regards,
Gunnar
 

Erel

B4X founder
Staff member
Licensed User
Longtime User
It can cause unforseen problems in some devices
Try / Catch blocks do not behave differently on different devices.

You can nest multiple blocks. Your code is valid.
The debugger might be more fragile with complex catch blocks. However such issues will not happen in release mode.
 
Upvote 0

Tempomaster

Active Member
Licensed User
Longtime User
Try / Catch blocks do not behave differently on different devices.

You can nest multiple blocks. Your code is valid.
The debugger might be more fragile with complex catch blocks. However such issues will not happen in release mode.

I'm really glad to hear that. A big thank you.:)

Best regards,
Gunnar
 
Upvote 0
Top