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

warning in constant declaration...

Former Member
0 Likes
939

i define as

constants: cc type C value '000000'.

and i get a warning during syntax check as

value specification is longer than the corresponding field.

why ? how to correct ?

thks

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
879

The constant in your case should be defined as or else it assumes it as 1 char.

CONSTANTS:cc(6) type c value '000000',

-Anthony.

5 REPLIES 5
Read only

Former Member
0 Likes
879

Hi,

Change the declaration as mentioned below.

constants: cc type char6 value '000000'.

Generally the length of the value specified should not be greater than lengh of the data type.

In your example..you have type c which is of length 1 but you have specified the value which is of length 6.

Thanks

Naren

Read only

Former Member
0 Likes
880

The constant in your case should be defined as or else it assumes it as 1 char.

CONSTANTS:cc(6) type c value '000000',

-Anthony.

Read only

Former Member
0 Likes
879

declare like this:

Constants : cc(6) type c value '000000'.

Read only

Former Member
0 Likes
879

U can use this statement as well.

CONSTANTS:cc type c length 6 value '000000'.

Regards,

Joy.

Read only

Former Member
0 Likes
879

Hi,

When you declare a variable as constant it means that the field length should be specified such that the field should be restricted to store values greater than its range in the entire program.

The value assignment to the constant is that it stores the value entirely if its with in range or does not try to store if its out of the length range...

Because they allow you to store data under a particular name within the memory area of a program. Its like synchronous.... Stores anything with in range.... stores nothing if its out of bounds.

Hope this would make to clear you issue.

Regards

Narin Nandivada.