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

Error in extended syntax check

Former Member
0 Likes
819

HI all,

I have declared some constants like this.

constants: c_str1(20) value 'abcdefg,,,,,',

c_str2(4) value 'xyz',

c_str(30).

concatenate c_str1 c_str2 into c_str.

I am getting an error for c_str1 in extended syntax check that 'charetecter strings without text elements will not be translated'.

I am not writing c_str1 anywhere and I just need it for concatenation.

When I tried like this

constants: c_str1(20) value 'abcdefg,,,,,,,'(000).

It is showing a sysntax error that offset is not allowed.

Please provide me the answer.

Regards,

Mungala.

7 REPLIES 7
Read only

Former Member
0 Likes
756

Try declaring like this:

constants: c_str1(20) type c value 'abcdefg,,,,,',

c_str2(4) type c value 'xyz',

c_str(30) type c.

Thanks,

SKJ

Read only

RichHeilman
Developer Advocate
Developer Advocate
0 Likes
756

How about if you simply add the switch to turn the message off.

constants: c_str1(20) value 'abcdefg,,,,,'.    "#EC

Regards,

Rich Heilman

Read only

suresh_datti
Active Contributor
0 Likes
756

Why don't you declare text elements? ie

data: w_str(30).
concatenate  'abcdefg,,,,,'(t01) 'xyz'(t02) into w_str.

double click on t01 & t02 save & activate the text elements.

Activate the program & do the SLIN..

~Suresh

Read only

Former Member
0 Likes
756

Hi,

Instead of constants you can declare a variable..


DATA: v_data type char30.

v_data = text-001. 

* Double click on text-001 to create a text element..And give the text there..

Thanks

Naren

Read only

Former Member
0 Likes
756

hi Praveena,

do this way

concatenate text-001 text-002 into c_str.

double click on text-001 and text-002 and create text elements with abcdefg,,,,,' and 'xyz' values. In 4.6 and above versions .. you got to save and activate ...else just save to remove that error .

REgards,

Santosh

Read only

former_member196280
Active Contributor
0 Likes
756

Do the declarations like this it will work

constants: c_str1(20) value 'abcdefg,,,,,',

c_str2(4) value 'xyz',

Data: c_str(30).

concatenate c_str1 c_str2 into c_str.

Note: constant values cannot be modified during runtime. So, you declare target as type c.

Reward points to all useful answers.

Regards,

SaiRam

Read only

Former Member
0 Likes
756

Define one text element with id 001.

constants: c_str1(20) value text-001,

c_str2(4) value 'xyz',

c_str(30).

<b>By the way observed 2 more errors:

1) Constant must have a value.

2) you can not change value of constant by statement:

concatenate c_str1 c_str2 into c_str.</b>

You need to define a variable and concatenate contents in that.