Application Development 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: 

simple qa : '999' or 999

Former Member
0 Kudos

when i use where number = '999' or number = 999 what's the difftent...

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi,

When you use the assignment operator with quotes, what ever value is entered within quotes will be assigned to that variable.

Eg,.



data: number type i.

number = '999'.
write: number.

Here 999 will be the output. i,e the value 999 is assigned to number when specified within quotes.

When you use direct assignment,



data: number type i,
         999 type i.

999 = ' 555'.

number = 999.

write: number.

When you assign a variable to another variable you wont use quotes. In the above example 999 is a variable and not a value. Only 555 is the value assigned in quotes. So the output will be 555.

Hope you are clear now.

Regards,

Vikranth

3 REPLIES 3

Former Member
0 Kudos

Hi,

When you use the assignment operator with quotes, what ever value is entered within quotes will be assigned to that variable.

Eg,.



data: number type i.

number = '999'.
write: number.

Here 999 will be the output. i,e the value 999 is assigned to number when specified within quotes.

When you use direct assignment,



data: number type i,
         999 type i.

999 = ' 555'.

number = 999.

write: number.

When you assign a variable to another variable you wont use quotes. In the above example 999 is a variable and not a value. Only 555 is the value assigned in quotes. So the output will be 555.

Hope you are clear now.

Regards,

Vikranth

Former Member
0 Kudos

above post explain clearly .

quotes are useed for char and sting . but when u will assigned to the variable which is a typr of integer then inside quotes values it will assigned to the variable .

but in case of string its must u have to provide a value in quotes. ''

rgds aryan

Former Member
0 Kudos

'999' will be considered as hardcode.