Strange things happened when I executed the code below.
After I entered 2 for OPTS to ran OBJ_D2, I could never leave the loop.
But if I comment out the "OUTTRAP" statements, everything will go fine.
So could anyone explain what OUTTRAP has done to my loop?
Thanks in advance.
==================================
/* REXX */                                                              
DO FOREVER                                                              
  say DISPLAY_UNIT_D                                                    
  PULL OPTS                                                             
  SELECT                                                               
  WHEN OPTS = X                                                         
  THEN leave                                                            
  WHEN OPTS = 1                                                         
  THEN say  OBJ_D1                                                      
  WHEN OPTS = 2                                                         
  THEN call OBJ_D2                                                      
  WHEN OPTS = 3                                                         
  THEN say  OBJ_D3                                                      
  WHEN OPTS = 4                                                         
  THEN say  OBJ_D4                                                       
  OTHERWISE                                                            
    SAY 'opts = '||opts                                                 
    say 'sigl = '||sigl                                                 
    SAY 'You entered the wrong option.'                                 
    PULL                                                                 
  END                                                                    
END                                                                      
exit                                                                     
                                                                         
OBJ_D2:                                                                 
   X = OUTTRAP("COMP_VAR",5,"CONCAT")                              
     "LISTC"                                                         
  Y = OUTTRAP('OFF')                                             
  SAY 
  ...                                                                           
                         
RETURN                                                                 

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [EMAIL PROTECTED] with the message: GET IBM-MAIN INFO
Search the archives at http://bama.ua.edu/archives/ibm-main.html

Reply via email to