IBM SC34-5764-01 User Manual

Page 187

Advertising
background image

The VALUE form of the SIGNAL instruction allows a branch to a label whose name is determined at the
time of execution. This can safely effect a multi-way CALL (or function call) to internal routines because
any DO loops, and so forth, in the calling routine are protected against termination by the call mechanism.

Example:

fred='PETE'
call multiway fred, 7

....
....

exit
Multiway: procedure

arg label .

/* One word, uppercase

*/

/* Can add checks for valid labels here */

signal value label

/* Transfer control to wherever

*/

....

Pete: say arg(1) '!' arg(2) /* Displays: "PETE ! 7"

*/

return

SIGNAL

Chapter 13. Keyword Instructions

165

Advertising