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

String using variables

Former Member
0 Likes
921

I have the following statement

field2 = field2 + v1(v2).

Where v1 and v2 are variables or data elements.

1 ACCEPTED SOLUTION
Read only

former_member194669
Active Contributor
0 Likes
902

Hi,

Not necessary to hardcode v2 value.

aRs

8 REPLIES 8
Read only

former_member194669
Active Contributor
0 Likes
902

Hi,

As per your code v1 and v2 are variables.

aRs

Read only

0 Likes
902

Yes, V1 and V2 are variable.

Is this possible or I have to give a hard code number

depending on V1 and V2 I want my string to display the values

Read only

0 Likes
902

Hi,

It is possible to display the values.

Check this code.

data v1 type string value 'Hello'.

write v1+2(3).

Kindly reward points by clicking the star on the left of reply,if it helps.

Read only

0 Likes
902

Let me elobarate,

Let us say field2 has string value 'Please Help'

data: V1 type i value 2,

V2 type i value3.

can I have

field2 = field2 + V1(V2).

ie.. now field2 has 'eas'.

Read only

0 Likes
902
data: field2 type str value 'Please Help'.
data: V1 type i value 2,
      V2 type i value 3.

field2 = field2+V1(V2). " Remove spaces here before and after '+' (PLUS)
write : field2.

Check this... it works

Reward for useful answers

Regards

Gopi

Read only

former_member194669
Active Contributor
0 Likes
903

Hi,

Not necessary to hardcode v2 value.

aRs

Read only

former_member194669
Active Contributor
0 Likes
902

Hi,

field2 = field2+v1(v2). "without space

give equalent result as

field2 = field2+2(3)

aRs

Read only

Former Member
0 Likes
902

Thanks for everyone for helping.