PULL Instruction
In earlier chapters
PULL was described as an instruction that reads input from the terminal
and assigns it to one or more variables. If however, the data stack
contains information, the PULL instruction takes information from
the data stack; and when the data stack is empty, PULL takes information
from the terminal. For information about the data stack, see Storing Information in the Data Stack. PULL changes character information to
uppercase and assigns it to one or more variable names. When PULL
is followed by more than one variable, it parses the information into
the available variables.
SAY 'What is the quote for the day?' /* user enters "Knowledge */
/* is power." */
PULL word1 word2 word3
/* word1 contains 'KNOWLEDGE' */
/* word2 contains 'IS' */
/* word3 contains 'POWER.' */The PARSE PULL instruction assigns information, without
altering it, to variable names.
SAY 'What is the quote for the day?' /* user enters "Knowledge */
/* is power." */
PARSE PULL word1 word2 word3
/* word1 contains 'Knowledge' */
/* word2 contains 'is' */
/* word3 contains 'power.' */PARSE UPPER PULL causes the same result as PULL in that it changes character information to uppercase before assigning it to one or more variables.