Try/Except Syntax in APL

Viewed 53

How to use Try/Except in APL

Using :Trap is not working, Why and how to fix?

Code:

∇F←R
:Trap
⎕←1÷0
:Catch
⎕←'Error'
:EndTrap
F←0
∇
R
1 Answers

Use this

∇F←R
:Trap 1
⎕←1÷0
:Catch
⎕←'Error'
:EndTrap
F←0
∇
R

Instead of

∇F←R
:Trap
⎕←1÷0
:Catch
⎕←'Error'
:EndTrap
F←0
∇
R

:Trap always need right argument

Related