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

What this small code does? And how do I do it in Unicode.

0 Likes
600

Hi.

I got the following code and I really don't know what it does or even why. All I know It's not UC enabled ( since it's uxinf the type x).

I was thinking I might be converting from ascii representation to text or something like that but I'm not that sure.

FORM TRANSLATE_FIELD USING STRING_TRAN

CHANGING STRING1.

DATA: STRING(255),

len1(3) type i,

LEN(3) TYPE I,

NUM(3) TYPE I,

I(3) TYPE I.

DATA: C VALUE 'A',

X TYPE X.

FIELD-SYMBOLS:<fc> type c.

STRING = STRING_TRAN.

len1 = strlen( STRING ).

LEN = 0.

NUM = 0.

while len < len1.

i = STRING+len(3).

move i to x.

assign x to <fc> casting type c.

move <fc> to c.

MOVE C TO STRING1+NUM.

len = len + 3.

NUM = NUM + 1.

endwhile.

ENDFORM. " TRANSLATE_FIELD

Thanks

Ariel

4 REPLIES 4
Read only

anuj_srivastava
Active Participant
0 Likes
559

Hi ,

Display the code in change mode .On top u will see the tab Goto.In this u will see the Attributes.

Click on attributes and it will poen a popup window.In this window at the bottom u will see the 'Unicode checks active' .

You need to check it in order to make this code unicode compatible.

Regards,

Anuj

Read only

Sandeep_Panghal
Product and Topic Expert
Product and Topic Expert
0 Likes
559

So you want to make this code UC enabled ??

Read only

0 Likes
559

Hi.

I want to make this small code UC enabled. Since there is a move of TYPE x into char this is not OK at the mopment.

the problem is I don't really know or understand how to convert itr to UC enabled program.

You can notice it takes clusters of 3 chars (bytes ?) long and convert them to char.

For example 101 = e 100 = d 099 = c.... 😆 101099101 -> ece .

Thanks

Ariel

Read only

0 Likes
559

Closing old msg.