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

if help

Former Member
0 Likes
838

Hallow here I have a if statement and I wont that

If no_file = 'X'. do do.. and leave program <b>else.</b> Exit the if and continue in program

How I do that

regards

IF no_file = 'X'.

<b>Do…

Leave program!</b>

ELSE.

<b>EXIT(contnue with program).</b>

endif.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
810

Hi,

U actually dont need to write anything in else.

U can simply write

IF no_file = 'X'.

Do…

Leave program!

Endif.

So, if the condition gets satisfied then only it will go inside and after processing leave the program else it will continue with the program.

Regards,

Himanshu

7 REPLIES 7
Read only

Former Member
0 Likes
811

Hi,

U actually dont need to write anything in else.

U can simply write

IF no_file = 'X'.

Do…

Leave program!

Endif.

So, if the condition gets satisfied then only it will go inside and after processing leave the program else it will continue with the program.

Regards,

Himanshu

Read only

Former Member
0 Likes
810

Hi,

If No_file = 'X'.

Leave program.

endif.

if the condition is true only then u will leave the program.

santhosh

Read only

kostas_tsioubris
Contributor
0 Likes
810

Hi,

if i understand your requirement you should do like this...

IF no_file = 'X'.

Do…

leave program.

ELSE.

*you don't need something here....

endif.

Read only

Former Member
0 Likes
810

Hi

No need to write else statement, if the no_file is not equal to 'X', it will automatically continue with rest of program.

Just use if endif. & write the processing in itself

Thanks

Sandeep

Reward if helpful

Read only

Former Member
0 Likes
810

Hi

Dont put else part. Just look at this.

IF no_file = 'X'.

Do…

Leave program!

Endif.

Write:/ 'After if statement'.

If this condition get satisfied it will leave the program else it will continue with the program by coming out of if condition.

Do reward points to the suitable answer and close the thread.

Regards

Haritha.

Read only

Former Member
0 Likes
810

U can do,

IF no_file = 'X'.
LEAVE PROGRAM.
ELSE.
DO SOMETHING.
ENDIF.

regards

Read only

Former Member
0 Likes
810

Hi Antonoi,

Here is your code.

IF no_file = 'X'.

Do…

Leave program!

ELSE.

EXIT(contnue with program).

endif.

The modified code is

<b>IF no_file = 'X'.

Leave program

endif.</b>

Hope this resolves your query.

Reward all the helpful answers.

Regards