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: 

Cast Char20 to Char80

alberto_colonna
Participant
0 Kudos

Hello,

I have to variables (The first of the type char80 and the other char20).

Now I want to assign the value of the variable (char20) to the variable (char80).

I always get the error message, that the types are not compatible.

Is it possible to cast from char20 to char80?

Best regards & thanks in advance

Alberto

7 REPLIES 7

JozsefSzikszai
Active Contributor
0 Kudos

hi Alberto,

how are the variables defined? If they are :

var20 TYPE CHAR20

and

var80 TYPE CHAR80

than var80 = var20 should work without problems.

probably you can copy your code here

ec

Former Member
0 Kudos

Hi,

You can use the Type casting here, but why don;t you write like this

Move CAHR1 to CHAR2+0(20).

Regards

Sudheer

Former Member
0 Kudos

data : a type char20, b type char80.

a = 'Vasu'.

b = a.

write 😕 b.

It is not showing any error.....please check ur code....

Regards

vasu

Former Member
0 Kudos

Hi Alberto,

if what Eric not wok, u can try "Write to":

try it:

<b>write <char20> to <char80>.</b>

Regards

Allan Cristian

0 Kudos

thanks Allen, but what Eric writes, that always works...

0 Kudos

hi Eric,

ya it's work, but we don't know him code...

it's working perfectly, I said only another way to do it...

excuse me anything;

was not mine intention to offend,

Really, I'm sorry...

Former Member
0 Kudos

Hi Alberto,

you wrote "assign".

So you'd like to assign field symbols like this?

field-symbols: <f1> type char20,
               <f2> type char80.

assign <f2> to <f1> casting.

Then you need to use the keyword casting to cast the types.

Best regards

Sven