Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Help on Clear Screen

Status
Not open for further replies.

Goenitz

Technical User
Sep 11, 2002
7
SG
Pardon me if this question seems basic but i still cant solve it. How do you get to clear screen in the application window of cobol during runtime? i have tried using:

DISPLAY ERASE AT 0101.

Although it clear the screen but it does not clear the contents in the ACCEPT statement. Any other ways to solve this problem? Please help.
 
Hi Goenitz,

This is an adddition to 3gm question.

Clearing the screen is one thing. Clearing the content of a variable is another thing altogether.

You probably should explain to us what it is you are trying to accomplish. This will give you (and others) answers to questions you probably haven't thought about yet.

Dimandja
 
Pardon me if this question seems basic but i still cant solve it. How do you get to clear screen in the application window of cobol during runtime? i have tried using:

DISPLAY ERASE AT 0101.

Although it clear the screen but it does not clear the contents in the ACCEPT statement. Any other ways to solve this problem? Please help.

Thanks Dimandja
This is the content that i wish to clear after prompting user's accept input.

01 CUSTOMER-REC.
02 CUSTOMER-NAME PIC X(20).
02 STREET-NO PIC X(25).
02 CITY-STATE-ZIP PIC X(25).
02 CREDIT-PUR-AMT PIC 9(6)V99.
02 NO-OF-PAYMENTS PIC 9(2).

77 MAIN-MENU-CHOICE PIC 9(1).

is there a need to clear the contents one by one?
 
Hi Goenitz,

I am not familiar with your COBOL language environment, but, I guess, in DISPLAY ERASE AT 0101, ERASE is a variable probably containing an escape sequence, and 0101 is probably the top left corner of your screen (row 1, column 1).

If I am correct, this means that the DISPLAY statement will affect your hardware (video display), but not your software (CUSTOMER-REC, MAIN-MENU-CHOICE).

If you wish to clear the varibales you posted, try coding either:
INITIALIZE CUSTOMER-REC, MAIN-MENU-CHOICE
or:
MOVE SPACES TO <PIC X variables>
MOVE ZEROES TO <PIC 9 variables>

I must admit that having said all that, I still don't understand what you are really trying to accomplish - my answers may not be the best solution to your problem.

Dimandja
 
Thanks once again Dimandja,
but i don think i phrase my question properly so that why the problem still lies there. i try to rephrase it in this way:

FILE SECTION.
FD CUSTOMER-FILE
LABEL RECORDS ARE STANDARD
VALUE OF FILE-ID IS &quot;CUSTOMER.DAT&quot;
DATA RECORD IS CUSTOMER-REC.

01 CUSTOMER-REC.
02 CUSTOMER-NAME PIC X(20).
02 STREET-NO PIC X(25).
02 CITY-STATE-ZIP PIC X(25).
02 CREDIT-PUR-AMT PIC 9(6)V99.
02 NO-OF-PAYMENTS PIC 9(2).

.........
.........
.........

INPUT-PARA.
DISPLAY &quot;ENTER THE CUSTOMER NAME: &quot; AT 0810.
ACCEPT CUSTOMER-NAME AT 0850.
DISPLAY &quot;ENTER THE STREET NUMBER: &quot; AT 1010.
ACCEPT STREET-NO AT 1050.
DISPLAY &quot;ENTER CITY, STATE AND ZIP-CODE: &quot;
AT 1210.
ACCEPT CITY-STATE-ZIP AT 1250.
DISPLAY &quot;ENTER AMOUNT OF CREDIT PAYMENT:&quot;
AT 1410.
ACCEPT CREDIT-PUR-AMT AT 1450.
DISPLAY &quot;ENTER NUMBER OF PAYMENTS:&quot; AT 1610.
ACCEPT NO-OF-PAYMENTS AT 1650.
WRITE CUSTOMER-REC.

........
........

assume that i have prompt the user with the ACCEPT clause, and the user entered all the values for the five different inputs one by one, i decide to enter another record.
so the problem lies here:
whatever the user entered previously (ex: 'goenitz' for CUSTOMER-NAME), the next time when application screen prompts again, the previous value 'goenitz' still appear in the beside the &quot;ENTER THE CUSTOMER NAME: &quot;. So how do i get rid or clear the contents in order to have a blank prompt rather then a 'goenitz' prompt? i have to backspace 'goenitz' in order to type in fresh data. Same applies to the next 4 inputs...
Thx.
 
I think you should try clearing the variables one by one or simply INITIALIZE the 01 levels.

Have you tried:

INPUT-PARA.
DISPLAY ERASE AT 0101.

MOVE SPACES TO CUSTOMER-NAME
DISPLAY &quot;ENTER THE CUSTOMER NAME: &quot; AT 0810.
ACCEPT CUSTOMER-NAME AT 0850.

MOVE SPACES TO STREET-NO
DISPLAY &quot;ENTER THE STREET NUMBER: &quot; AT 1010.
ACCEPT STREET-NO AT 1050.

etc...?


Keep me updated.

Dimandja
 
Hi Dimandja,
i have tried the codes that u gave me. Your concept works but the only error is to change

MOVE SPACE TO CUSTOMER-NAME

instead of:

MOVE SPACES TO CUSTOMER-NAME

for a single alphabet 'S' it traped me for a long time. *sigh*

thanks by the way!

Another question:
how do u change the size of the application window? i have been working a small window and hope to maximize it. I tried looking at the properties but nothing is mentioned. also tried to changed to settings of MS-DOS but it is not applicable.. Even my lecturers cant help.
 
Goenitz,

Please, please, PLEASE tell me what COBOL compiler you are using.

If your compiler does not treat:
Code:
MOVE SPACE TO CUSTOMER-NAME
as exactly the same as
Code:
MOVE SPACES TO CUSTOMER-NAME
your compiler is totally inadequate and certainly very nonstandard.

Tom Morrison
 
Hi Goenitz,

I agree with Tom: your compiler is quite peculiar. SPACE but no SPACES?

If you told us the name of it, we wouldn't tell a soul; promise...

Just put its name [machinegun] here.

Dimandja
 
Hi Goenitz,

Have you solved your problem? If so, could you post what you did?

If not, could you post the name of the compiler (and OS) you are using?

For us to try answering &quot;how to change the window size&quot;, we need to know your compiler and the environment (windows or other).

Dimandja

 
hi Dimandja,
its ok that i can share my complier version with u guys.
but the only info i can provide is:

Micro Focus NetExpress UE V3.0 revision 255 Compiler
Copyright (C) 1984-1999 Micro Focus Ltd. URN AXCGG/AA0/00000

if u need more detail u got to tell me the steps to retrieve them...

wat do u mean by environment? i only know that i m working using micro focus netexpress 3.0.14.
 
Hey,

in microfocus works on DOS based Appl. always with

DISPLAY SPACES UPON CRT

to clear sreens.


LUDGER
 
Hi Goenitz,

I have not used NetExpress; somebody else may be able to give specific help on this.

Anyway, from the constructs you use (DISPLAY ... AT 0801), I can surmise that you are using a text screen (24 lines, 80 columns), and not a graphics screen (example: 1280 by 1024 pixels).

While graphics screens use 'windows' controls for sizing, text screens can be sized only (to my knowledge) by changing the font size. With some compilers, you are allowed to specify fewer lines/columns for text screens.

Dimandja
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top