Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Different between LEAVE SCREEN & SET SCREEN 0

Former Member
0 Likes
7,518

Hi there,

I have a program where I have the main screen and another one.

to call the secondary screen I used CALL SCREEN 0200. However I have doubt when I'm executing the BACK.

I don't know the different between SET SCREEN 0. and LEAVE SCREEN 0100.

when 'BACK'.

SET SCREEN 0.

OR

LEAVE SCREEN 0100.

Can anyone tell me what is the different?

Thanks in advance

Alexis

1 ACCEPTED SOLUTION
Read only

Former Member
3,127

Set screen is to set the next screen after the processing of current screen is over.

Call screen : Calls the screen scr; scr is the number of a screen of the main program. You use SET SCREEN 0. or LEAVE SCREEN. to define the return from the CALL screen.

.

leave screen will take you to the next screen..(either defined statically using next screen attribute or dynamically defined using SET screen command)

If the next screen is specified dynamically, you can use the short form " LEAVE TO SCREEN scr." instead of a combination of the "SET SCREEN scr." and "LEAVE SCREEN." commands.

5 REPLIES 5
Read only

Former Member
0 Likes
3,127

This message was moderated.

Read only

Former Member
0 Likes
3,127

This message was moderated.

Read only

Former Member
0 Likes
3,127

This message was moderated.

Read only

Former Member
3,128

Set screen is to set the next screen after the processing of current screen is over.

Call screen : Calls the screen scr; scr is the number of a screen of the main program. You use SET SCREEN 0. or LEAVE SCREEN. to define the return from the CALL screen.

.

leave screen will take you to the next screen..(either defined statically using next screen attribute or dynamically defined using SET screen command)

If the next screen is specified dynamically, you can use the short form " LEAVE TO SCREEN scr." instead of a combination of the "SET SCREEN scr." and "LEAVE SCREEN." commands.

Read only

Former Member
0 Likes
3,127

Hi,

Set Screen

Syntax

Set screen <number>.

In module pool program

Case okcode.

When u2018DISPu2019.

Set screen 200.

When u2018LISTu2019.

Set screen 300.

Endcase.

In this case, the entire processing of current screen takes place and then the system branches out to next screen. If you want to branch out to the next screen without processing the current screen, LEAVE SCREEN should be used along with the SET SCREEN.

For Example:

Case okcode..

When u2018DISPu2019.

Set screen 200.

Leave Screen.

When u2018LISTu2019.

Set screen 300.

Leave Screen.

Endcase.

When SET SCREEN is used, control cannot be transferred to the main screen or previous screen, unless you write code for the same.

Leave to screen

To SET a new screen without processing current screen, you need to use the following two statements together:

SET SCREEN 200.

LEAVE SCREEN.

Or a Single statement

LEAVE TO SCREEN 200.

Regards,

Bhaskar