‎2007 May 31 2:37 AM
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.
‎2007 May 31 2:51 AM
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
‎2007 May 31 2:53 AM
‎2007 May 31 2:58 AM
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
‎2007 May 31 3:02 AM
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
‎2007 May 31 3:55 AM
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
‎2007 May 31 3:58 AM
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
‎2007 May 31 4:03 AM
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.