OS/2 Procedures Language 2/REXX


Inf-HTML [About][Toc][Index] 0.9b (c) 1995 Peter Childs


PULL





 >>----PULL------+------------+-----;----------><
                 +--template--+


PULL is used to read a string from the head of the currently active REXX 
data queue. It is a short form of the instruction: 

 >>--PARSE UPPER PULL--+-------------+-;----><
                       +--template---+

The current head-of-queue is read as one string.  If no template is 
specified, no further action is taken, and the string is effectively 
discarded.  If specified, a template is a list of symbols separated by 
blanks or patterns. The string is translated to uppercase (for example, a 
lowercase a-z to an uppercase A-Z), and then parsed into variables 
according to the rules described in the section on parsing in the OS/2 
Procedures Language 2/REXX Reference.  Use the PARSE PULL instruction if 
you do not want uppercase translation. 
Note:    If the current data queue is empty, PULL reads instead from STDIN 
         (typically, the keyboard). The length of data read by the PULL 
         instruction is restricted to the length of strings contained by 
         variables. 
 
 Example: 

 Say 'Do you want to erase the file?  Answer Yes or No:'
 Pull answer .
 if answer='NO' then Say 'The file will not be erased.'
 
 
 Here the dummy placeholder "." is used on the template to isolate the 
 first word the user enters. 
 The number of lines currently in the queue can be found with the QUEUED 
 built-in function.   

Inf-HTML End Run - Successful