Information Technology Reference
In-Depth Information
screen (1,30) “Account Number Inquiry” ,
which will display the above heading in the first row starting at position 30. Any data in
those positions on the line when this command is executed will be deleted. Note that if
there happened to be something on the screen in positions 1 through 29, it will not be
removed. To clear this trash, you can use the line
screen (1,1) “ ” (1,30) “Account Number Inquiry”
or
screen (1,1) “ Account Number Inquiry”
and the result in either case will be only those three words on the first line. This centers
the heading in the line.
The first number after the left parenthesis indicates the row where the field will
start while the second number represents the column. It should be noted that only the first
line will be effected by our screen command. If we use either line above in our program
we may run into some difficulties since our screen could already have information all
over it on other lines. Our data would still be displayed but so would much of the data
that was there before. We will need to clear the screen and this can be done with the line
screen erase
where the combination of these two keywords will remove all previous data from the
screen so that we will be ready to display just what we want and nothing more. If we use
the line
screen (20,20) “error”
the literal error will print on line 20 starting in the 20th column but nothing will be erased
before column 20. Adding the line
screen erase (20,1)
before that screen line with the literal error will erase whatever is on line 20. Thus
screen erase (10,18)
will erase everything on line 10 starting in column 18.
The complete program would look like the following:
program-name : acctinq
define file acctfile record account-record status acct-status key account-number structure
account-number integer( 9)
last-name character (18)
first-name character (15)
middle-initial character
street-address character (25)
city character (15)
state character (2)
zip-code integer( 5)
balance signed decimal (6.2)
define error-msg character (60) value “ ”
screen erase
screen (1,30) “Account Number Inquiry”
screen (4,20) “account number:”
Search WWH ::




Custom Search