IP

Prompts for and accepts input from the terminal.

Syntax

IP{c{r}}

Syntax Elements

c is an optional prompt character.

If c is used, it remains in effect until reset with a new IBN, IBP, IN, or IP command.

If c is not used, it defaults to the last prompt character used or to a colon (:) if no other character is specified.

r is a direct or indirect reference to a buffer or select register where the input data is to be placed.

Operation

IP{c} places data in the active input buffer, replacing the existing parameter pointed to by the buffer pointer.

IPcr places input in the buffer or select register specified by r. The prompt character is required in this case.

Leading and trailing blanks are removed and embedded blanks are replaced with a single attribute mark, thereby replacing the current parameter in the input buffer with multiple parameters. If the input is to a file buffer attribute (as specified by r) and contains embedded blanks, the embedded blanks are replaced with a single attribute mark as above. The attributes then replace consecutive attributes in the item. For example:

If you enter "ABC   DEF   GHI" when the command, IP?&3.2  is executed, the values "ABC", "DEF", and "GHI" would replace attributes two, three, and four, respectively, in file buffer 3.

If you want to retain blanks input at the terminal and treat the input text as a single attribute, use the IBP command.

Pressing RETURN only in response to an input prompt nulls the current parameter as pointed to by the buffer pointer.

The input buffer pointer does not change position after an IP command.

Note: The IP command does not read stacked input the way an INPUT statement in DataBasic does. All input commands in Proc ignore stacked data.

Example 1

Command Input PIB Before PIB After
IP?
3-93
UPDATE^INV
         
UPDATE^INV^3-9393
         

Example 2

Command Input PIB Before PIB After
IP:
  XXX   YY
3^234^56^78^
3^XXX^YY^56^78
  

Example 3

Command Input PIB Before PIB After
IP?
RETURN
ABC^DEF^GHI
   
ABC^^GHI
   

Example 4

Command Input File Buffer 1 Before File Buffer 1 After
IP:&1.1
JONES
000 AB-221
001 SMITH

002 2500
000 AB-221
001 JONES

002 2500

Example 5

Command Input File Buffer 4 Before File Buffer 4 After
IP?&4.1
22 RED PEN

000 2831
001 15
002 BROWN
003 PENCIL
000 2831
001 22
002 RED
003 PEN

Go to top button