Introduction

Language Structure

IB Statements

File System

Comet 32 Runtime

Index

(Init Input Data)

Mnemonic: (Init Input Data)
Discussion: The (Init Input Data) mnemonic is a one-time function that when issued prior to a new INPUT statement causes the screen field(s) to be initialized from the current variable(s) instead of from the existing screen data.

Rules for using this mnemonic:

  • The current variable(s) must be set prior to using (Init Input Data)
  • (Init Input Data) must be issued prior to the INPUT statement to which it applies
  • (Init Input Data) is a one-time function

This mnemonic works with a single input value as well as multiple input values within a single INPUT statement.

Note: This mnemonic applies to the new INPUT statement, not to the legacy INPUT statement.

Example 1:
LENGTH 1 & LOCAL OPTION$
.
.
.
OPTION$ = "Y"
Print (Init Input Data)
Input @(10,10),OPTION$

In this example, OPTION$ is set to an initial value of "Y" and the (Init Input Data) mnemonic is issued before the INPUT statement. When the INPUT statement is executed, "Y" is displayed at column 10, row 10, and the cursor is positioned at that same location.

Example 2:
LENGTH 25 & LOCAL DATA$,MOREDATA$
LENGTH 5.2 & LOCAL X
.
.
.
DATA$ = "abc123def456ghi789jkl"
MOREDATA$ = "This is more data"
X = 22.5

Print (Init Input Data)

Input @(10,10),DATA$,10;_
      @(10,12),MOREDATA$;_
      @(10,14),X

In this example, three values are set to their initial values, and then the (Init Input Data) mnemonic is issued. When the INPUT statement is executed, the initial values are displayed.

Note that a length override of 10 is applied to DATA$, which displays the first 10 characters of the input field. (The input data will scroll horizontally if the cursor moves beyond the bounds of the field's entry area.)