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

about logical expression

Former Member
0 Likes
948

Hello ,

can we compare like this ?

if i = j + 10.

statements

endif.

if it is not possible to compare like this what is the reason.

And is there any option to compare like this.

Thank And Regards,

Sham

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
924

You cannot directly use expression in CONDITIONAL Statements.(Its possible in C,C++ etc)

USE:

J = J + 10.

If i = j.

Endif.

Hope this resolve your issue.

Regards,

Gurpreet.

10 REPLIES 10
Read only

Former Member
0 Likes
924

do like this,

declare var type of j

then var = j + 10

if i = var .

do

endif.

Read only

0 Likes
924

Hello ,

I know we can do like that .

But can we do like this. In some languages this option is valid.

so i am trying like this.

Read only

0 Likes
924

>

> declare var type of j

Typo?

Read only

Former Member
0 Likes
924

This message was moderated.

Read only

Former Member
0 Likes
924

U cannot compare like that , instead write as ..

j = j + 10.

if i = j .

*statements ...

endif.

Read only

0 Likes
924

no you cant do..like that in if

no expression in condition

Read only

0 Likes
924

in if u can not use + , - , * and / operators

Read only

Former Member
0 Likes
925

You cannot directly use expression in CONDITIONAL Statements.(Its possible in C,C++ etc)

USE:

J = J + 10.

If i = j.

Endif.

Hope this resolve your issue.

Regards,

Gurpreet.

Read only

Former Member
0 Likes
924

Please run this test program.

REPORT test.

data: i type i VALUE 2,
      k type i VALUE 5,
      temp type i.

temp = i + 3.
if k = temp.
  WRITE: 'I am a Lazy person.I can not try out myself.shame on me :-( Ugly!!!'.
ENDIF.

Read only

0 Likes
924

Hello Amit,

I know how to write it.

But some of my friend have asked me can we write like this, then i thought we can write in C language so i have tried it .

Once read my reply