Silverfrost Forums

Welcome to our forums

INTERRUPT subroutines

9 Aug 2007 4:11 #2162

if we search 'INTERRUPT subroutines' or 'set_trap@' in FTN95 user's manual, we can find the following sample code:

 EXTERNAL QUITH
 INTEGER(KIND=3) :: X
 COMPLEX(KIND=2) :: LABEL
 COMMON LABEL
 CALL LABEL@(LABEL,*1)
 CALL SET_TRAP@(QUITH,X,0)

1 READ *,N DO 2 I=1,N 2 PRINT *,N PRINT *,'END OF LOOP' GOTO 1 END

 INTERRUPT SUBROUTINE QUITH
 COMPLEX(KIND=2) :: LABEL
 COMMON LABEL
 CALL COU('Quit trapped!')
 CALL JUMP@(LABEL)
 END

but I tried it in PLATO 3, always got 'access violation' run time error at the line of 'CALL SET_TRAP@(QUITH,X,0)' please help!

11 Aug 2007 3:33 #2165

The call to set_trap@ should be...

CALL SET_TRAP@(QUITH,0)

X should not appear in the sample.

Please login to reply.