Silverfrost Logo About Us | Contact Us
 

JUMP@

Platform

Win32

Purpose

To execute a non-local jump (Win32 only).

Syntax

SUBROUTINE JUMP@(LABEL)
COMPLEX (KIND=2) LABEL

Description

This routine is described here since its most frequent use is in conjuction with SET_TRAP@. It takes a label generated by LABEL@ and jumps to the label. The label must exist in a still active routine, but this can be any distance down the call stack.

Example

Consider a program designed to process several sets of data and to carry on even after errors had been diagnosed in earlier data sets:

 

PROGRAM INPUT
COMPLEX (KIND=2) RECOVER
CALL LABEL@(RECOVER,*10)
10 DO
   CALL READ_DATA
   CALL PROCESS
   END DO
CONTAINS
  SUBROUTINE ERROR(MESSAGE)
   CHARACTER*(*) MESSAGE
   CALL COU@(MESSAGE)
   CALL JUMP@(RECOVER)
  END SUBROUTINE ERROR
END PROGRAM INPUT

 

Subroutine ERROR could be called from anywhere inside PROCESS (even many layers down inside subroutine calls) to return to label 10 ready to process the next data set. The use of JUMP@ obviates the need to provide an explicit error exit path back to the main program. It is the user's responsibility to ensure that the LABEL is still accessible when JUMP@ is called, i.e. that the routine which is called LABEL@ has not yet exited.

 

 

Copyright © 1999-2017 Silverfrost Limited