Hello I am searching to identify the exception handling for catching the error in case I want to pass value into the array where it doesn't have its size. Pls. look at the below code:
program main integer, allocatable :: a(:) object('System.AccessViolationException') EXC1 allocate (a(1:5)) print*, 'program start' try do i = 1, 10 a(i) = i print*, 'i=',i,'a(i)=',a(i) enddo catch(EXC1) throw 'Something' print*, 'In catch block - insufficient array size to write' finally print*, 'In FINALLY BLOCK' endtry end program main
The output is given below:
program start i= 1a(i)= 1 i= 2a(i)= 2 i= 3a(i)= 3 i= 4a(i)= 4 i= 5a(i)= 5 i= 6a(i)= 6 i= 7a(i)= 7 i= 8a(i)= 8 i= 9a(i)= 9 i= 10a(i)= 10 In FINALLY BLOCK
This is not helping to catch the error to find out beyond a(5) it should throw error. the above object ('System.AccessViolationException') does not catch the error.
Any one can help to identify proper error handling method in 'System.????'. What is the reference should I make in Silverfrost FTN95 Express Visual compiler. Appreciate your help quickly. Thanks